|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es6: true, |
| 5 | + }, |
| 6 | + extends: [ |
| 7 | + 'react-app', |
| 8 | + 'airbnb', |
| 9 | + 'plugin:react/recommended', |
| 10 | + 'prettier/react', |
| 11 | + 'prettier/@typescript-eslint', |
| 12 | + ], |
| 13 | + globals: { |
| 14 | + Atomics: 'readonly', |
| 15 | + SharedArrayBuffer: 'readonly', |
| 16 | + }, |
| 17 | + parser: '@typescript-eslint/parser', |
| 18 | + parserOptions: { |
| 19 | + ecmaFeatures: { |
| 20 | + jsx: true, |
| 21 | + }, |
| 22 | + ecmaVersion: 2018, |
| 23 | + sourceType: 'module', |
| 24 | + allowImportExportEverywhere: true, |
| 25 | + project: './tsconfig.json', |
| 26 | + tsconfigRootDir: '.', |
| 27 | + }, |
| 28 | + plugins: [ |
| 29 | + 'react', |
| 30 | + 'react-hooks', |
| 31 | + 'prettier', |
| 32 | + '@typescript-eslint', |
| 33 | + 'import-helpers', |
| 34 | + ], |
| 35 | + rules: { |
| 36 | + camelcase: 'off', |
| 37 | + 'object-curly-newline': 'off', |
| 38 | + 'comma-dangle': 'off', |
| 39 | + 'arrow-parens': 'off', |
| 40 | + 'prettier/prettier': 'error', |
| 41 | + 'global-require': 'off', |
| 42 | + 'react/prop-types': 'off', |
| 43 | + 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }], |
| 44 | + 'no-param-reassign': 'off', |
| 45 | + 'no-underscore-dangle': 'off', |
| 46 | + 'function-paren-newline': 'off', // temporary |
| 47 | + 'implicit-arrow-linebreak': 'off', // temporary |
| 48 | + indent: 'off', // temporary |
| 49 | + 'operator-linebreak': 'off', // temporary |
| 50 | + 'react/jsx-filename-extension': [ |
| 51 | + 'error', |
| 52 | + { |
| 53 | + extensions: ['.tsx'], |
| 54 | + }, |
| 55 | + ], |
| 56 | + 'react-hooks/rules-of-hooks': 'error', |
| 57 | + 'react-hooks/exhaustive-deps': 'warn', |
| 58 | + 'import/prefer-default-export': 'off', |
| 59 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 60 | + '@typescript-eslint/explicit-member-accessibility': 'off', |
| 61 | + 'import/extensions': [ |
| 62 | + 'error', |
| 63 | + 'ignorePackages', |
| 64 | + { |
| 65 | + ts: 'never', |
| 66 | + tsx: 'never', |
| 67 | + }, |
| 68 | + ], |
| 69 | + 'import-helpers/order-imports': [ |
| 70 | + 'warn', |
| 71 | + { |
| 72 | + newlinesBetween: 'always', |
| 73 | + groups: [ |
| 74 | + '/^(react|styled-components)/', |
| 75 | + 'module', |
| 76 | + ['/^~/components/', '/^~/Layout/'], |
| 77 | + '/^~/contexts/', |
| 78 | + ['parent', 'sibling', 'index'], |
| 79 | + '/^~/assets/', |
| 80 | + '/^(~|.)/styles/', |
| 81 | + ], |
| 82 | + alphabetize: { order: 'asc', ignoreCase: true }, |
| 83 | + }, |
| 84 | + ], |
| 85 | + }, |
| 86 | + settings: { |
| 87 | + 'import/extensions': ['js', 'jsx', '.ts', '.tsx'], |
| 88 | + 'import/resolver': { |
| 89 | + '@typescript-eslint/parser': ['.ts', '.tsx'], |
| 90 | + alias: { |
| 91 | + map: [['~', './src']], |
| 92 | + extensions: ['.js', '.ts', '.tsx', '.d.ts', '.json'], |
| 93 | + }, |
| 94 | + }, |
| 95 | + 'import/resolver': { |
| 96 | + typescript: {}, |
| 97 | + }, |
| 98 | + }, |
| 99 | +}; |
0 commit comments