|
1 | 1 | import eslint from "@eslint/js";
|
2 |
| -import react from "eslint-plugin-react"; |
3 |
| -import jsxA11y from "eslint-plugin-jsx-a11y"; |
4 |
| -import importPlugin from "eslint-plugin-import"; |
| 2 | +import eslintConfigPrettier from "eslint-config-prettier/flat"; |
5 | 3 | import tseslint from "typescript-eslint";
|
6 | 4 | import sonarjs from "eslint-plugin-sonarjs";
|
7 |
| -import prettierConfig from "eslint-config-prettier"; |
8 |
| -import globals from "globals"; |
9 | 5 |
|
10 | 6 | export default tseslint.config(
|
11 | 7 | eslint.configs.recommended,
|
12 |
| - ...tseslint.configs.recommended, |
13 |
| - importPlugin.flatConfigs.recommended, |
14 |
| - react.configs.flat.recommended, |
15 |
| - react.configs.flat["jsx-runtime"], |
16 |
| - jsxA11y.flatConfigs.recommended, |
| 8 | + tseslint.configs.recommended, |
17 | 9 | sonarjs.configs.recommended,
|
18 |
| - prettierConfig, |
| 10 | + eslintConfigPrettier, |
19 | 11 | {
|
20 | 12 | files: ["**/*.{js,ts,jsx,tsx}"],
|
21 |
| - languageOptions: { |
22 |
| - globals: { |
23 |
| - ...globals.browser, |
24 |
| - ...globals.node, |
25 |
| - Atomics: "readonly", |
26 |
| - SharedArrayBuffer: "readonly", |
27 |
| - }, |
28 |
| - parserOptions: { |
29 |
| - ecmaVersion: 2018, |
30 |
| - sourceType: "module", |
31 |
| - }, |
32 |
| - }, |
33 | 13 | rules: {
|
34 |
| - // base rule needs to be disabled to prevent errors with the ts version |
35 |
| - // see https://typescript-eslint.io/rules/#extension-rules |
| 14 | + "@typescript-eslint/no-use-before-define": "off", |
| 15 | + "@typescript-eslint/no-inferrable-types": "off", |
36 | 16 | "no-unused-vars": "off",
|
37 | 17 | "@typescript-eslint/no-unused-vars": "error",
|
38 |
| - "@typescript-eslint/no-explicit-any": "off", |
| 18 | + "@typescript-eslint/interface-name-prefix": "off", |
39 | 19 | "@typescript-eslint/consistent-type-assertions": [
|
40 | 20 | "error",
|
41 | 21 | { assertionStyle: "angle-bracket" },
|
42 | 22 | ],
|
43 |
| - "import/no-unresolved": "off", |
| 23 | + "@typescript-eslint/no-explicit-any": "off", |
| 24 | + "@typescript-eslint/explicit-function-return-type": "off", |
44 | 25 | },
|
45 | 26 | },
|
46 |
| - // overriding rules specifically for test files |
47 | 27 | {
|
48 | 28 | files: ["**/*(specs|tests)/**", "**/*.spec.ts"],
|
49 | 29 | rules: {
|
50 | 30 | "@typescript-eslint/no-empty-function": "off",
|
51 |
| - "sonarjs/no-identical-functions": "off", |
52 |
| - "sonarjs/no-duplicate-string": "off", |
53 | 31 | },
|
54 | 32 | }
|
55 | 33 | );
|
0 commit comments