-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove random eslint warnings after upgrade
- Loading branch information
1 parent
632662b
commit fa4c405
Showing
2 changed files
with
61 additions
and
51 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 |
---|---|---|
@@ -1,72 +1,81 @@ | ||
import react from "eslint-plugin-react"; | ||
import reactHooks from "eslint-plugin-react-hooks"; | ||
import typescriptEslint from "@typescript-eslint/eslint-plugin"; | ||
import prettier from "eslint-plugin-prettier"; | ||
import { fixupPluginRules } from "@eslint/compat"; | ||
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"; | ||
import react from 'eslint-plugin-react'; | ||
import reactHooks from 'eslint-plugin-react-hooks'; | ||
import typescriptEslint from '@typescript-eslint/eslint-plugin'; | ||
import prettier from 'eslint-plugin-prettier'; | ||
import { fixupPluginRules } from '@eslint/compat'; | ||
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 | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all, | ||
}); | ||
|
||
export default [...compat.extends( | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"prettier", | ||
), { | ||
export default [ | ||
...compat.extends( | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'prettier', | ||
), | ||
{ | ||
plugins: { | ||
react, | ||
"react-hooks": fixupPluginRules(reactHooks), | ||
"@typescript-eslint": typescriptEslint, | ||
prettier, | ||
react, | ||
'react-hooks': fixupPluginRules(reactHooks), | ||
'@typescript-eslint': typescriptEslint, | ||
prettier, | ||
}, | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.jest, | ||
Atomics: "readonly", | ||
SharedArrayBuffer: "readonly", | ||
}, | ||
globals: { | ||
...globals.browser, | ||
...globals.jest, | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly', | ||
}, | ||
|
||
parser: tsParser, | ||
ecmaVersion: 2018, | ||
sourceType: "module", | ||
parser: tsParser, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
|
||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
}, | ||
|
||
settings: { | ||
"import/resolver": { | ||
typescript: {}, | ||
}, | ||
'import/resolver': { | ||
typescript: {}, | ||
}, | ||
react: { | ||
version: 'detect', // React version. "detect" automatically picks the version you have installed. | ||
}, | ||
}, | ||
|
||
rules: { | ||
"no-unused-vars": "off", | ||
'no-unused-vars': 'off', | ||
|
||
"@typescript-eslint/no-unused-vars": ["warn", { | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
caughtErrorsIgnorePattern: "^_", | ||
}], | ||
'@typescript-eslint/no-unused-vars': [ | ||
'warn', | ||
{ | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
caughtErrorsIgnorePattern: '^_', | ||
}, | ||
], | ||
|
||
"react/jsx-uses-react": "off", | ||
"react/react-in-jsx-scope": "off", | ||
"react/display-name": "off", | ||
'react/jsx-uses-react': 'off', | ||
'react/react-in-jsx-scope': 'off', | ||
'react/display-name': 'off', | ||
}, | ||
}]; | ||
}, | ||
]; |
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