|
1 |
| -/** @type {import('@types/eslint').Linter.BaseConfig} */ |
| 1 | +/** |
| 2 | + * This is intended to be a basic starting point for linting in your app. |
| 3 | + * It relies on recommended configs out of the box for simplicity, but you can |
| 4 | + * and should modify this configuration to best suit your team's needs. |
| 5 | + */ |
| 6 | + |
| 7 | +/** @type {import('eslint').Linter.Config} */ |
2 | 8 | module.exports = {
|
3 | 9 | root: true,
|
4 |
| - extends: [ |
5 |
| - "@remix-run/eslint-config", |
6 |
| - "@remix-run/eslint-config/node", |
7 |
| - "@remix-run/eslint-config/jest-testing-library", |
8 |
| - "prettier", |
9 |
| - ], |
10 |
| - globals: { |
11 |
| - shopify: "readonly" |
| 10 | + parserOptions: { |
| 11 | + ecmaVersion: "latest", |
| 12 | + sourceType: "module", |
| 13 | + ecmaFeatures: { |
| 14 | + jsx: true, |
| 15 | + }, |
| 16 | + }, |
| 17 | + env: { |
| 18 | + browser: true, |
| 19 | + commonjs: true, |
| 20 | + es6: true, |
12 | 21 | },
|
| 22 | + ignorePatterns: ["!**/.server", "!**/.client"], |
| 23 | + |
| 24 | + // Base config |
| 25 | + extends: ["eslint:recommended"], |
| 26 | + |
| 27 | + overrides: [ |
| 28 | + // React |
| 29 | + { |
| 30 | + files: ["**/*.{js,jsx,ts,tsx}"], |
| 31 | + plugins: ["react", "jsx-a11y"], |
| 32 | + extends: [ |
| 33 | + "plugin:react/recommended", |
| 34 | + "plugin:react/jsx-runtime", |
| 35 | + "plugin:react-hooks/recommended", |
| 36 | + "plugin:jsx-a11y/recommended", |
| 37 | + ], |
| 38 | + settings: { |
| 39 | + react: { |
| 40 | + version: "detect", |
| 41 | + }, |
| 42 | + formComponents: ["Form"], |
| 43 | + linkComponents: [ |
| 44 | + { name: "Link", linkAttribute: "to" }, |
| 45 | + { name: "NavLink", linkAttribute: "to" }, |
| 46 | + ], |
| 47 | + "import/resolver": { |
| 48 | + typescript: {}, |
| 49 | + }, |
| 50 | + }, |
| 51 | + }, |
| 52 | + |
| 53 | + // Typescript |
| 54 | + { |
| 55 | + files: ["**/*.{ts,tsx}"], |
| 56 | + plugins: ["@typescript-eslint", "import"], |
| 57 | + parser: "@typescript-eslint/parser", |
| 58 | + settings: { |
| 59 | + "import/internal-regex": "^~/", |
| 60 | + "import/resolver": { |
| 61 | + node: { |
| 62 | + extensions: [".ts", ".tsx"], |
| 63 | + }, |
| 64 | + typescript: { |
| 65 | + alwaysTryTypes: true, |
| 66 | + }, |
| 67 | + }, |
| 68 | + }, |
| 69 | + extends: [ |
| 70 | + "plugin:@typescript-eslint/recommended", |
| 71 | + "plugin:import/recommended", |
| 72 | + "plugin:import/typescript", |
| 73 | + ], |
| 74 | + }, |
| 75 | + |
| 76 | + // Node |
| 77 | + { |
| 78 | + files: [".eslintrc.cjs"], |
| 79 | + env: { |
| 80 | + node: true, |
| 81 | + }, |
| 82 | + }, |
| 83 | + ], |
13 | 84 | };
|
0 commit comments