|
| 1 | +module.exports = { |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es2021: true, |
| 5 | + node: true, |
| 6 | + }, |
| 7 | + plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'], |
| 8 | + extends: [ |
| 9 | + 'eslint:recommended', |
| 10 | + 'next', |
| 11 | + 'next/core-web-vitals', |
| 12 | + 'plugin:@typescript-eslint/recommended', |
| 13 | + 'prettier', |
| 14 | + ], |
| 15 | + rules: { |
| 16 | + 'no-unused-vars': 'off', |
| 17 | + 'no-console': 'warn', |
| 18 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 19 | + |
| 20 | + 'react/display-name': 'off', |
| 21 | + 'react/jsx-curly-brace-presence': [ |
| 22 | + 'warn', |
| 23 | + { props: 'never', children: 'never' }, |
| 24 | + ], |
| 25 | + |
| 26 | + //#region //*=========== Unused Import =========== |
| 27 | + '@typescript-eslint/no-unused-vars': 'off', |
| 28 | + 'unused-imports/no-unused-imports': 'warn', |
| 29 | + 'unused-imports/no-unused-vars': [ |
| 30 | + 'warn', |
| 31 | + { |
| 32 | + vars: 'all', |
| 33 | + varsIgnorePattern: '^_', |
| 34 | + args: 'after-used', |
| 35 | + argsIgnorePattern: '^_', |
| 36 | + }, |
| 37 | + ], |
| 38 | + //#endregion //*======== Unused Import =========== |
| 39 | + |
| 40 | + //#region //*=========== Import Sort =========== |
| 41 | + 'simple-import-sort/exports': 'warn', |
| 42 | + 'simple-import-sort/imports': [ |
| 43 | + 'warn', |
| 44 | + { |
| 45 | + groups: [ |
| 46 | + // ext library & side effect imports |
| 47 | + ['^@?\\w', '^\\u0000'], |
| 48 | + // {s}css files |
| 49 | + ['^.+\\.s?css$'], |
| 50 | + // Lib and hooks |
| 51 | + ['^@/lib', '^@/hooks'], |
| 52 | + // static data |
| 53 | + ['^@/data'], |
| 54 | + // components |
| 55 | + ['^@/components', '^@/container'], |
| 56 | + // zustand store |
| 57 | + ['^@/store'], |
| 58 | + // Other imports |
| 59 | + ['^@/'], |
| 60 | + // relative paths up until 3 level |
| 61 | + [ |
| 62 | + '^\\./?$', |
| 63 | + '^\\.(?!/?$)', |
| 64 | + '^\\.\\./?$', |
| 65 | + '^\\.\\.(?!/?$)', |
| 66 | + '^\\.\\./\\.\\./?$', |
| 67 | + '^\\.\\./\\.\\.(?!/?$)', |
| 68 | + '^\\.\\./\\.\\./\\.\\./?$', |
| 69 | + '^\\.\\./\\.\\./\\.\\.(?!/?$)', |
| 70 | + ], |
| 71 | + ['^@/types'], |
| 72 | + // other that didnt fit in |
| 73 | + ['^'], |
| 74 | + ], |
| 75 | + }, |
| 76 | + ], |
| 77 | + //#endregion //*======== Import Sort =========== |
| 78 | + }, |
| 79 | + globals: { |
| 80 | + React: true, |
| 81 | + JSX: true, |
| 82 | + }, |
| 83 | +}; |
0 commit comments