Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

.eslintrc.cjs

88 lines2.2 KB

1const config = {
2 root: true,
3 parser: '@typescript-eslint/parser',
4 plugins: ['@typescript-eslint', 'import'],
5 extends: [
6 'plugin:@typescript-eslint/eslint-recommended',
7 'plugin:@typescript-eslint/recommended',
8 'plugin:import/recommended',
9 'plugin:import/typescript',
10 'prettier',
11 ],
12 env: {
13 browser: true,
14 es2020: true,
15 },
16 parserOptions: {
17 tsconfigRootDir: __dirname,
18 project: './tsconfig.base.json',
19 sourceType: 'module',
20 ecmaVersion: 2020,
21 },
22 settings: {
23 'import/parsers': {
24 '@typescript-eslint/parser': ['.ts', '.tsx'],
25 },
26 'import/resolver': {
27 typescript: true,
28 },
29 react: {
30 version: 'detect',
31 },
32 },
33 rules: {
34 '@typescript-eslint/ban-types': 'off',
35 '@typescript-eslint/ban-ts-comment': 'off',
36 '@typescript-eslint/consistent-type-imports': [
37 'error',
38 { prefer: 'type-imports' },
39 ],
40 '@typescript-eslint/explicit-module-boundary-types': 'off',
41 '@typescript-eslint/no-empty-interface': 'off',
42 '@typescript-eslint/no-explicit-any': 'off',
43 '@typescript-eslint/no-non-null-assertion': 'off',
44 '@typescript-eslint/no-unnecessary-condition': 'error',
45 '@typescript-eslint/no-unused-vars': 'off',
46 '@typescript-eslint/no-inferrable-types': [
47 'error',
48 { ignoreParameters: true },
49 ],
50 'import/default': 'off',
51 'import/export': 'off',
52 'import/namespace': 'off',
53 'import/newline-after-import': 'error',
54 'import/no-cycle': 'error',
55 'import/no-duplicates': 'off',
56 'import/no-named-as-default-member': 'off',
57 'import/no-unresolved': ['error', { ignore: ['^@tanstack/'] }],
58 'import/no-unused-modules': ['off', { unusedExports: true }],
59 'import/order': [
60 'error',
61 {
62 groups: [
63 'builtin',
64 'external',
65 'internal',
66 'parent',
67 'sibling',
68 'index',
69 'object',
70 'type',
71 ],
72 },
73 ],
74 'no-redeclare': 'off',
75 'no-shadow': 'error',
76 'sort-imports': ['error', { ignoreDeclarationSort: true }],
77 },
78 overrides: [
79 {
80 files: ['**/*.test.{ts,tsx}'],
81 rules: {
82 '@typescript-eslint/no-unnecessary-condition': 'off',
83 },
84 },
85 ],
87​
88module.exports = config