Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: migrateeslint-plugin-import toeslint-plugin-import-x#11217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
JounQin wants to merge2 commits intotypescript-eslint:main
base:main
Choose a base branch
Loading
fromJounQin:chore/import-x
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletionseslint.config.mjs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import eslint from '@eslint/js';
import tseslintInternalPlugin from '@typescript-eslint/eslint-plugin-internal';
import vitestPlugin from '@vitest/eslint-plugin';
import eslintPluginPlugin from 'eslint-plugin-eslint-plugin';
importimportPluginfrom 'eslint-plugin-import';
importimportXPlugin, { createNodeResolver }from 'eslint-plugin-import-x';
import jsdocPlugin from 'eslint-plugin-jsdoc';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import perfectionistPlugin from 'eslint-plugin-perfectionist';
Expand DownExpand Up@@ -38,7 +38,7 @@ export default tseslint.config(
['@typescript-eslint']: tseslint.plugin,
['@typescript-eslint/internal']: tseslintInternalPlugin,
['eslint-plugin']: eslintPluginPlugin,
['import']:importPlugin,
['import-x']:importXPlugin,
['jsdoc']: jsdocPlugin,
// @ts-expect-error -- https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/1038
['jsx-a11y']: jsxA11yPlugin.flatConfigs.recommended.plugins['jsx-a11y'],
Expand All@@ -54,6 +54,7 @@ export default tseslint.config(
},
/* eslint-enable no-useless-computed-key */
settings: {
'import-x/resolver-next': createNodeResolver(),
perfectionist: {
order: 'asc',
partitionByComment: true,
Expand DownExpand Up@@ -263,24 +264,24 @@ export default tseslint.config(
],

//
// eslint-plugin-import
// eslint-plugin-import-x
//
// enforces consistent type specifier style for named imports
'import/consistent-type-specifier-style': 'error',
'import-x/consistent-type-specifier-style': 'error',
// disallow non-import statements appearing before import statements
'import/first': 'error',
'import-x/first': 'error',
// Require a newline after the last import/require in a group
'import/newline-after-import': 'error',
'import-x/newline-after-import': 'error',
// Forbid import of modules using absolute paths
'import/no-absolute-path': 'error',
'import-x/no-absolute-path': 'error',
// disallow AMD require/define
'import/no-amd': 'error',
'import-x/no-amd': 'error',
// forbid default exports - we want to standardize on named exports so that imported names are consistent
'import/no-default-export': 'error',
'import-x/no-default-export': 'error',
// disallow imports from duplicate paths
'import/no-duplicates': 'error',
'import-x/no-duplicates': 'error',
// Forbid the use of extraneous packages
'import/no-extraneous-dependencies': [
'import-x/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
Expand All@@ -289,15 +290,15 @@ export default tseslint.config(
},
],
// Forbid mutable exports
'import/no-mutable-exports': 'error',
'import-x/no-mutable-exports': 'error',
// Prevent importing the default as if it were named
'import/no-named-default': 'error',
'import-x/no-named-default': 'error',
// Prohibit named exports
'import/no-named-export': 'off', // we want everything to be a named export
'import-x/no-named-export': 'off', // we want everything to be a named export
// Forbid a module from importing itself
'import/no-self-import': 'error',
'import-x/no-self-import': 'error',
// Require modules with a single export to use a default export
'import/prefer-default-export': 'off', // we want everything to be named
'import-x/prefer-default-export': 'off', // we want everything to be named

// enforce a sort order across the codebase
'perfectionist/sort-imports': 'error',
Expand DownExpand Up@@ -448,7 +449,7 @@ export default tseslint.config(
name: 'no-default-export',
rules: {
// requirement
'import/no-default-export': 'off',
'import-x/no-default-export': 'off',
},
},

Expand DownExpand Up@@ -491,7 +492,7 @@ export default tseslint.config(
],

// specifically for rules - default exports makes the tooling easier
'import/no-default-export': 'off',
'import-x/no-default-export': 'off',

'no-restricted-syntax': [
'error',
Expand All@@ -510,7 +511,7 @@ export default tseslint.config(
name: 'eslint-plugin/source-files/rules-index-file',
rules: {
// enforce alphabetical ordering
'import/order': ['error', { alphabetize: { order: 'asc' } }],
'import-x/order': ['error', { alphabetize: { order: 'asc' } }],
'sort-keys': 'error',
},
},
Expand DownExpand Up@@ -609,7 +610,7 @@ export default tseslint.config(
files: ['packages/website/src/**/*.?(m|c)ts?(x)'],
name: 'website/source-files',
rules: {
'import/no-default-export': 'off',
'import-x/no-default-export': 'off',
// allow console logs in the website to help with debugging things in production
'no-console': 'off',
},
Expand All@@ -619,7 +620,7 @@ export default tseslint.config(
name: 'website/source-files/mocks-and-declaration-files',
rules: {
// mocks and declaration files have to mirror their original package
'import/no-default-export': 'off',
'import-x/no-default-export': 'off',
},
},
{
Expand Down
3 changes: 2 additions & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,7 +83,7 @@
"cspell": "^9.0.0",
"eslint": "^9.26.0",
"eslint-plugin-eslint-plugin": "^6.3.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import-x": "^4.14.1",
"eslint-plugin-jsdoc": "^50.5.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-perfectionist": "^4.12.3",
Expand DownExpand Up@@ -115,6 +115,7 @@
"@types/node": "^22.0.0",
"@types/react": "^18.2.14",
"eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch",
"react-helmet-async": "npm:@slorber/react-helmet-async@1.3.0",
"prettier": "3.5.0",
"react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch",
"tsx": "^4.7.2",
Expand Down
15 changes: 8 additions & 7 deletionspackages/website/package.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,12 +28,13 @@
},
"dependencies": {
"@babel/runtime": "^7.24.4",
"@docusaurus/core": "^3.2.1",
"@docusaurus/plugin-client-redirects": "^3.2.1",
"@docusaurus/plugin-pwa": "^3.2.1",
"@docusaurus/preset-classic": "^3.2.1",
"@docusaurus/remark-plugin-npm2yarn": "^3.2.1",
"@docusaurus/theme-common": "^3.2.1",
"@docusaurus/core": "^3.7.0",
"@docusaurus/plugin-client-redirects": "^3.7.0",
"@docusaurus/plugin-content-blog": "^3.7.0",
"@docusaurus/plugin-pwa": "^3.7.0",
"@docusaurus/preset-classic": "^3.7.0",
"@docusaurus/remark-plugin-npm2yarn": "^3.7.0",
"@docusaurus/theme-common": "^3.7.0",
"@typescript-eslint/parser": "workspace:*",
"@typescript-eslint/website-eslint": "workspace:*",
"@uiw/react-shields": "2.0.1",
Expand All@@ -55,7 +56,7 @@
"typescript": "*"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.2.1",
"@docusaurus/module-type-aliases": "^3.7.0",
"@types/mdast": "^4.0.3",
"@types/react": "*",
"@types/unist": "^3.0.2",
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp