forked from import-js/eslint-plugin-import
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use eslint-compat-utils to support eslint v9 (#62)
not flat config yet
- Loading branch information
Showing
39 changed files
with
198 additions
and
107 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": patch | ||
--- | ||
|
||
feat: use eslint-compat-utils to support eslint v9 (not flat config yet) |
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,40 @@ | ||
diff --git a/node_modules/eslint-compat-utils/dist/index.d.ts b/node_modules/eslint-compat-utils/dist/index.d.ts | ||
index 993098a..ccb61ad 100644 | ||
--- a/node_modules/eslint-compat-utils/dist/index.d.ts | ||
+++ b/node_modules/eslint-compat-utils/dist/index.d.ts | ||
@@ -1,21 +1,23 @@ | ||
-import { Rule, SourceCode } from 'eslint'; | ||
+import { TSESLint } from '@typescript-eslint/utils' | ||
+ | ||
+type RuleContext = TSESLint.RuleContext<string, readonly unknown[]> | ||
|
||
/** | ||
* Returns an extended instance of `context.sourceCode` or the result of `context.getSourceCode()`. | ||
* Extended instances can use new APIs such as `getScope(node)` even with old ESLint. | ||
*/ | ||
-declare function getSourceCode(context: Rule.RuleContext): SourceCode; | ||
+declare function getSourceCode(context: RuleContext): TSESLint.SourceCode; | ||
|
||
/** | ||
* Gets the value of `context.cwd`, but for older ESLint it returns the result of `context.getCwd()`. | ||
* Versions older than v6.6.0 return a value from the result of `process.cwd()`. | ||
*/ | ||
-declare function getCwd(context: Rule.RuleContext): string; | ||
+declare function getCwd(context: RuleContext): string; | ||
|
||
/** | ||
* Gets the value of `context.filename`, but for older ESLint it returns the result of `context.getFilename()`. | ||
*/ | ||
-declare function getFilename(context: Rule.RuleContext): string; | ||
+declare function getFilename(context: RuleContext): string; | ||
|
||
/** | ||
* Gets the value of `context.physicalFilename`, | ||
@@ -23,6 +25,6 @@ declare function getFilename(context: Rule.RuleContext): string; | ||
* Versions older than v7.28.0 return a value guessed from the result of `context.getFilename()`, | ||
* but it may be incorrect. | ||
*/ | ||
-declare function getPhysicalFilename(context: Rule.RuleContext): string; | ||
+declare function getPhysicalFilename(context: RuleContext): string; | ||
|
||
export { getCwd, getFilename, getPhysicalFilename, getSourceCode }; |
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
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
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
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
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
Oops, something went wrong.