-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #843 from remap-keys/change-eslint-configuration-f…
…ile-format Migrate the ESLint configuration file as the Flat Config format.
- Loading branch information
Showing
4 changed files
with
139 additions
and
42 deletions.
There are no files selected for viewing
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,67 @@ | ||
// This file was generated automatically by `npx @eslint/migrate-config .eslintrc.json`. | ||
// https://www.npmjs.com/package/@eslint/migrate-config | ||
|
||
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat"; | ||
import react from "eslint-plugin-react"; | ||
import prettier from "eslint-plugin-prettier"; | ||
import globals from "globals"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [...fixupConfigRules(compat.extends( | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:prettier/recommended", | ||
"prettier/react", | ||
)), { | ||
files: ["**/*.ts", "**/*.tsx"], | ||
plugins: { | ||
react: fixupPluginRules(react), | ||
prettier: fixupPluginRules(prettier), | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
...globals.browser, | ||
HIDDevice: "readonly", | ||
describe: "readonly", | ||
test: "readonly", | ||
expect: "readonly", | ||
fail: "readonly", | ||
assert: "readonly", | ||
}, | ||
|
||
parser: tsParser, | ||
ecmaVersion: 5, | ||
sourceType: "module", | ||
|
||
parserOptions: { | ||
version: 2018, | ||
|
||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
}, | ||
|
||
rules: { | ||
"prettier/prettier": ["warn", {}, { | ||
usePrettierrc: true, | ||
}], | ||
|
||
"no-unused-vars": "warn", | ||
"react/prop-types": "warn", | ||
}, | ||
}]; |
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