-
Notifications
You must be signed in to change notification settings - Fork 4
Update ESLint to v9+ #31
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
Changes from all commits
d48b89c
74f778e
20be7be
abb5fde
8afabe3
8f481d4
d97a38a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import js from "@eslint/js" | ||
| import importPlugin from "eslint-plugin-import" | ||
| import sonarjs from "eslint-plugin-sonarjs" | ||
| import eslintPluginUnicorn from "eslint-plugin-unicorn" | ||
| import { defineConfig, globalIgnores } from "eslint/config" | ||
daniel-richter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| import tseslint from "typescript-eslint" | ||
daniel-richter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // eslint-disable-next-line import/no-default-export | ||
| export default defineConfig([ | ||
| globalIgnores(["dist/*"]), | ||
daniel-richter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], | ||
| plugins: { js }, | ||
| extends: ["js/recommended"], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| projectService: { allowDefaultProject: ["eslint.config.js"] }, | ||
| tsconfigRootDir: import.meta.dirname, | ||
daniel-richter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| }, | ||
| }, | ||
daniel-richter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| importPlugin.flatConfigs.recommended, | ||
| importPlugin.flatConfigs.typescript, | ||
| tseslint.configs.recommended, | ||
| tseslint.configs.recommendedTypeChecked, | ||
| tseslint.configs.stylisticTypeChecked, | ||
| sonarjs.configs.recommended, | ||
| eslintPluginUnicorn.configs.recommended, | ||
|
Comment on lines
+9
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your ESLint configuration for both // eslint.common.config.js
import js from "@eslint/js";
import importPlugin from "eslint-plugin-import";
import sonarjs from "eslint-plugin-sonarjs";
import unicorn from "eslint-plugin-unicorn";
import tsEslint from "@typescript-eslint/eslint-plugin/flat";
import { defineConfig, globalIgnores } from "eslint/config";
export const shared = [
globalIgnores(["dist/*"]),
{
files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
plugins: { js },
extends: ["js/recommended"],
languageOptions: {
parserOptions: {
projectService: { allowDefaultProject: ["eslint.config.js"] },
tsconfigRootDir: import.meta.dirname,
},
},
},
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
tsEslint.configs.recommended,
tsEslint.configs.recommendedTypeChecked,
tsEslint.configs.stylisticTypeChecked,
sonarjs.configs.recommended,
unicorn.configs.recommended,
];
defineConfig([...shared, { rules: { /* overrides */ } }]);Then in each project’s |
||
| { | ||
| rules: { | ||
| "unicorn/no-array-for-each": "off", | ||
| "unicorn/prefer-string-replace-all": "off", | ||
| "unicorn/prevent-abbreviations": "off", | ||
| "no-plusplus": "off", | ||
| "no-param-reassign": ["error", { props: false }], | ||
| "unicorn/no-negated-condition": "off", | ||
| "@typescript-eslint/no-use-before-define": "off", | ||
| "import/extensions": "off", | ||
| "import/no-extraneous-dependencies": ["error", { devDependencies: true }], | ||
| "import/prefer-default-export": "off", | ||
| "import/no-default-export": "error", | ||
| "import/no-unresolved": "off", | ||
| }, | ||
| }, | ||
daniel-richter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ]) | ||
Uh oh!
There was an error while loading. Please reload this page.