Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(eslint): Migrate eslint to the new flat configuration format #1214

Merged
merged 6 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const EslintTypeScriptParser = require("@typescript-eslint/parser");
const ts = require("@typescript-eslint/eslint-plugin");
mwangggg marked this conversation as resolved.
Show resolved Hide resolved
const EslintPluginReactHooks = require("eslint-plugin-react-hooks");
const EslintPluginReact = require("eslint-plugin-react");
const EslintPluginImport = require("eslint-plugin-import");
const EslintPluginUnusedImports = require("eslint-plugin-unused-imports");
const EslintTypeScriptPlugin = require("@typescript-eslint/eslint-plugin");
const Prettier = require("prettier");

module.exports = [
//EslintPluginReact.configs["jsx-runtime", "recommended"],
//EslintPluginImport.configs.recommended,
//EslintPluginImport.configs.typescript,
//EslintTypeScriptPlugin.configs.recommended,
module.exports = [{
ignores: ['src/mirage/', '**/node_modules/'],
},
{
files: ['**/*.{ts,tsx,js}'],
languageOptions: {
// tells eslint to use the TypeScript parser
parser: EslintTypeScriptParser,
Expand Down Expand Up @@ -41,7 +41,7 @@ module.exports = [
},
// includes the typescript specific rules found here: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
plugins: {
"@typescript-eslint": EslintTypeScriptPlugin,
"@typescript-eslint": ts,
"react-hooks": EslintPluginReactHooks,
"react": EslintPluginReact,
"eslint-plugin-react-hooks": EslintPluginReactHooks,
Expand Down Expand Up @@ -80,6 +80,9 @@ module.exports = [
"warn",
{ "vars": "all", "varsIgnorePattern": "^_", "args": "after-used", "argsIgnorePattern": "^_" }
]
}
}
]
}
}];
//EslintPluginReact.configs["jsx-runtime", "recommended"],
//EslintPluginImport.configs.recommended,
//EslintPluginImport.configs.typescript,
//ts.configs.recommended,
mwangggg marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"test": "jest --maxWorkers=50% --coverage=true",
"test:ci": "jest --maxWorkers=50%",
"eslint": "yarn eslint:check",
"eslint:check": "eslint .",
"eslint:apply": "eslint --fix .",
"eslint:check": "eslint './src/**/*.{ts,tsx,js}'",
"eslint:apply": "eslint --fix './src/**/*.{ts,tsx,js}'",
"itest:preview": "HEADLESS_BROWSER=true concurrently -c 'auto' 'yarn:start:dev:preview --no-open' 'yarn:itest' --kill-others --success first",
"itest": "wait-on -l --httpTimeout 120000 -d 5000 http://localhost:9091 && jest --testMatch='**/itest/**/*.test.(ts|tsx)'",
"license:check": "license-check-and-add check -f license-config.json",
Expand Down
Loading