|
| 1 | +// @ts-nocheck |
| 2 | + |
| 3 | +import eslint from "@eslint/js"; |
| 4 | +import react from "eslint-plugin-react/configs/recommended.js"; |
| 5 | +import globals from "globals"; |
| 6 | +import tsLint from "typescript-eslint"; |
| 7 | + |
| 8 | +export default tsLint.config( |
| 9 | + { |
| 10 | + ignores: [ |
| 11 | + "dist/*", |
| 12 | + // Temporary compiled files |
| 13 | + "**/*.ts.build-*.mjs", |
| 14 | + |
| 15 | + // JS files at the root of the project |
| 16 | + "*.js", |
| 17 | + "*.cjs", |
| 18 | + "*.mjs", |
| 19 | + ], |
| 20 | + }, |
| 21 | + eslint.configs.recommended, |
| 22 | + ...tsLint.configs.recommended, |
| 23 | + { |
| 24 | + languageOptions: { |
| 25 | + parserOptions: { |
| 26 | + sourceType: "module", |
| 27 | + ecmaVersion: "latest", |
| 28 | + }, |
| 29 | + }, |
| 30 | + }, |
| 31 | + { |
| 32 | + rules: { |
| 33 | + // common |
| 34 | + semi: ['error', 'always'], |
| 35 | + 'arrow-parens': ['error', 'always'], |
| 36 | + 'no-unused-vars': 'off', |
| 37 | + 'comma-dangle': ['error', 'always-multiline'], |
| 38 | + 'comma-spacing': [2, { before: false, after: true }], |
| 39 | + // typescript |
| 40 | + '@typescript-eslint/no-explicit-any': 'off', |
| 41 | + '@typescript-eslint/no-var-requires': 'off', |
| 42 | + '@typescript-eslint/no-namespace': 'off', |
| 43 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 44 | + '@typescript-eslint/consistent-type-imports': 'error', |
| 45 | + '@typescript-eslint/no-unused-expressions': 'off', |
| 46 | + "@typescript-eslint/no-unused-vars": [ |
| 47 | + 1, |
| 48 | + { |
| 49 | + argsIgnorePattern: "^_", |
| 50 | + }, |
| 51 | + ], |
| 52 | + // other |
| 53 | + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', |
| 54 | + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', |
| 55 | + }, |
| 56 | + }, |
| 57 | + |
| 58 | + { |
| 59 | + files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"], |
| 60 | + ...react, |
| 61 | + languageOptions: { |
| 62 | + ...react.languageOptions, |
| 63 | + globals: { |
| 64 | + ...globals.serviceworker, |
| 65 | + ...globals.browser, |
| 66 | + }, |
| 67 | + }, |
| 68 | + |
| 69 | + settings: { |
| 70 | + react: { |
| 71 | + version: "detect", |
| 72 | + }, |
| 73 | + }, |
| 74 | + }, |
| 75 | +); |
0 commit comments