forked from import-js/eslint-plugin-import
-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: start TypeScript migration (#42)
- Loading branch information
Showing
108 changed files
with
998 additions
and
927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"eslint-plugin-import-x": minor | ||
--- | ||
|
||
feat!: start TypeScript migration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
const testCompiled = process.env.TEST_COMPILED === '1' | ||
|
||
const srcDir = testCompiled ? 'lib' : 'src' | ||
|
||
/** | ||
* @type {import('@jest/types').Config.InitialOptions} | ||
*/ | ||
module.exports = { | ||
collectCoverage: true, | ||
collectCoverage: !testCompiled, | ||
modulePathIgnorePatterns: ['<rootDir>/test/fixtures/with-syntax-error'], | ||
moduleNameMapper: { | ||
'^core/(.+)$': '<rootDir>/src/core/$1', | ||
'^eslint-plugin-import-x$': '<rootDir>/src/index.js', | ||
'^eslint-plugin-import-x/config/(.+)$': '<rootDir>/config/$1', | ||
'^core/(.+)$': `<rootDir>/${srcDir}/core/$1`, | ||
'^eslint-plugin-import-x$': `<rootDir>/${srcDir}`, | ||
'^eslint-plugin-import-x/package.json$': '<rootDir>/package.json', | ||
'^eslint-plugin-import-x/(.+)$': '<rootDir>/src/$1', | ||
'^rules/(.+)$': '<rootDir>/src/rules/$1', | ||
'^eslint-plugin-import-x/(.+)$': `<rootDir>/${srcDir}/$1`, | ||
'^rules/(.+)$': `<rootDir>/${srcDir}/rules/$1`, | ||
}, | ||
testMatch: [ | ||
'<rootDir>/test/**/*.spec.js', | ||
'<rootDir>/test/**/*.spec.ts', | ||
'!<rootDir>/test/fixtures/**/*.js', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts | ||
index 9a3a1fd..46b3961 100644 | ||
--- a/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts | ||
+++ b/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts | ||
@@ -6,6 +6,10 @@ import type { Scope } from './Scope'; | ||
import type { SourceCode } from './SourceCode'; | ||
export type RuleRecommendation = 'error' | 'strict' | 'warn' | false; | ||
interface RuleMetaDataDocs { | ||
+ /** | ||
+ * The category the rule falls under | ||
+ */ | ||
+ category?: string; | ||
/** | ||
* Concise description of the rule | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import type { PluginConfig } from '../types' | ||
|
||
/** | ||
* Default settings for Electron applications. | ||
*/ | ||
module.exports = { | ||
export = { | ||
settings: { | ||
'import-x/core-modules': ['electron'], | ||
}, | ||
} | ||
} satisfies PluginConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
import type { PluginConfig } from '../types' | ||
|
||
/** | ||
* Adds `.jsx` as an extension, and enables JSX parsing. | ||
* | ||
* Even if _you_ aren't using JSX (or .jsx) directly, if your dependencies | ||
* define jsnext:main and have JSX internally, you may run into problems | ||
* if you don't enable these settings at the top level. | ||
*/ | ||
module.exports = { | ||
export = { | ||
settings: { | ||
'import-x/extensions': ['.js', '.jsx'], | ||
}, | ||
|
||
parserOptions: { | ||
ecmaFeatures: { jsx: true }, | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
} | ||
} satisfies PluginConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import type { PluginConfig } from '../types' | ||
|
||
/** | ||
* Rules in progress. | ||
* | ||
* Do not expect these to adhere to semver across releases. | ||
* @type {Object} | ||
*/ | ||
module.exports = { | ||
export = { | ||
plugins: ['import-x'], | ||
rules: { | ||
'import-x/no-deprecated': 1, | ||
}, | ||
} | ||
} as PluginConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import type { PluginConfig } from '../types' | ||
|
||
/** | ||
* more opinionated config. | ||
* @type {Object} | ||
*/ | ||
module.exports = { | ||
export = { | ||
plugins: ['import-x'], | ||
rules: { | ||
'import-x/no-named-as-default': 1, | ||
'import-x/no-named-as-default-member': 1, | ||
'import-x/no-duplicates': 1, | ||
}, | ||
} | ||
} satisfies PluginConfig |
Oops, something went wrong.