-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add eslint@9 support and flat config (#3942)
- Loading branch information
Showing
15 changed files
with
394 additions
and
98 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-mobx": patch | ||
--- | ||
|
||
add eslint@9 support and flat config |
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
7 changes: 2 additions & 5 deletions
7
packages/eslint-plugin-mobx/__tests__/exhaustive-make-observable.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
7 changes: 2 additions & 5 deletions
7
packages/eslint-plugin-mobx/__tests__/missing-make-observable.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
7 changes: 2 additions & 5 deletions
7
packages/eslint-plugin-mobx/__tests__/no-anonymous-observer.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
7 changes: 2 additions & 5 deletions
7
packages/eslint-plugin-mobx/__tests__/unconditional-make-observable.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
29 changes: 29 additions & 0 deletions
29
packages/eslint-plugin-mobx/__tests__/utils/get-rule-tester.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const version = global.ESLINT_V; | ||
|
||
const { RuleTester } = require(`eslint-${version}`); | ||
const typescriptEslintParser = require("@typescript-eslint/parser"); | ||
|
||
function getRuleTesterConfig() { | ||
switch (version) { | ||
case 7: | ||
return { | ||
parser: require.resolve("@typescript-eslint/parser"), | ||
parserOptions: {}, | ||
}; | ||
case 9: | ||
return { | ||
languageOptions: { | ||
parser: typescriptEslintParser, | ||
parserOptions: {}, | ||
}, | ||
}; | ||
default: | ||
throw new Error(`Unknown or unspecified ESLINT_V (${String(version)})`); | ||
} | ||
} | ||
|
||
function getRuleTester() { | ||
return new RuleTester(getRuleTesterConfig()); | ||
} | ||
|
||
export { getRuleTester } |
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,10 @@ | ||
const buildConfig = require("../../jest.base.config") | ||
|
||
module.exports = buildConfig(__dirname, { | ||
displayName: 'eslint-plugin-mobx with eslint@7', | ||
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"], | ||
testRegex: "__tests__/[^/]+\\.(t|j)sx?$", | ||
globals: { | ||
ESLINT_V: 7 | ||
} | ||
}) |
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,10 @@ | ||
const buildConfig = require("../../jest.base.config") | ||
|
||
module.exports = buildConfig(__dirname, { | ||
displayName: 'eslint-plugin-mobx with eslint@9', | ||
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"], | ||
testRegex: "__tests__/[^/]+\\.(t|j)sx?$", | ||
globals: { | ||
ESLINT_V: 9 | ||
} | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** @see https://github.com/jsdom/jsdom/issues/3363 */ | ||
global.structuredClone = val => { | ||
return JSON.parse(JSON.stringify(val)) | ||
} |
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.