|
1 | | -import devupUiEslintPlugin from '@devup-ui/eslint-plugin' |
2 | | -import js from '@eslint/js' |
3 | | -import pluginQuery from '@tanstack/eslint-plugin-query' |
4 | | -import type { Linter } from 'eslint' |
5 | | -import * as mdx from 'eslint-plugin-mdx' |
6 | | -import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' |
7 | | -// @ts-ignore |
8 | | -import react from 'eslint-plugin-react' |
9 | | -// @ts-ignore |
10 | | -import hooksPlugin from 'eslint-plugin-react-hooks' |
11 | | -import simpleImportSort from 'eslint-plugin-simple-import-sort' |
12 | | -import unusedImports from 'eslint-plugin-unused-imports' |
13 | | -import tseslint from 'typescript-eslint' |
14 | | - |
15 | | -import { appPage, component, componentInterface } from '../rules' |
16 | | - |
17 | | -export default [ |
18 | | - { |
19 | | - ignores: [ |
20 | | - '**/node_modules/', |
21 | | - '**/build/', |
22 | | - '**/storybook-static/', |
23 | | - '**/dist/', |
24 | | - '**/next-env.d.ts', |
25 | | - '**/out/', |
26 | | - '**/.next/', |
27 | | - '**/public/', |
28 | | - '**/.df/', |
29 | | - '**/df/', |
30 | | - '**/coverage/', |
31 | | - '**/target/', |
32 | | - '**/venv/', |
33 | | - '**/.venv/', |
34 | | - '.husky/', |
35 | | - '!**/src/**', |
36 | | - '!vite.config.ts', |
37 | | - '!**/.storybook/**', |
38 | | - '**/__snapshots__/', |
39 | | - '**/.cache/', |
40 | | - ], |
41 | | - }, |
42 | | - ...devupUiEslintPlugin.configs.recommended, |
43 | | - react.configs.flat!.recommended, |
44 | | - js.configs.recommended, |
45 | | - eslintPluginPrettierRecommended, |
46 | | - ...tseslint.configs.recommended, |
47 | | - ...pluginQuery.configs['flat/recommended'], |
48 | | - { |
49 | | - settings: { |
50 | | - react: { |
51 | | - version: 'detect', |
52 | | - defaultVersion: '19', |
53 | | - }, |
54 | | - }, |
55 | | - plugins: { |
56 | | - 'react-hooks': hooksPlugin, |
57 | | - 'unused-imports': unusedImports, |
58 | | - 'simple-import-sort': simpleImportSort, |
59 | | - '@devup': { |
60 | | - rules: { |
61 | | - component, |
62 | | - 'app-page': appPage, |
63 | | - 'component-interface': componentInterface, |
64 | | - }, |
65 | | - }, |
66 | | - }, |
67 | | - rules: { |
68 | | - 'react/react-in-jsx-scope': 'off', |
69 | | - 'require-jsdoc': 'off', |
70 | | - 'valid-jsdoc': 'off', |
71 | | - 'prettier/prettier': [ |
72 | | - 'error', |
73 | | - { |
74 | | - endOfLine: 'auto', |
75 | | - trailingComma: 'all', |
76 | | - singleQuote: true, |
77 | | - semi: false, |
78 | | - }, |
79 | | - ], |
80 | | - 'no-trailing-spaces': 'error', |
81 | | - '@typescript-eslint/explicit-module-boundary-types': 'off', |
82 | | - '@typescript-eslint/no-explicit-any': 'off', |
83 | | - '@typescript-eslint/no-var-requires': 'off', |
84 | | - '@typescript-eslint/ban-ts-comment': 'off', |
85 | | - 'no-constant-condition': ['error', { checkLoops: false }], |
86 | | - 'react/jsx-curly-brace-presence': 'error', |
87 | | - camelcase: 'off', |
88 | | - 'simple-import-sort/imports': 'error', |
89 | | - 'simple-import-sort/exports': 'error', |
90 | | - 'react/jsx-sort-props': [ |
91 | | - 'error', |
92 | | - { |
93 | | - callbacksLast: false, |
94 | | - shorthandFirst: false, |
95 | | - shorthandLast: false, |
96 | | - ignoreCase: false, |
97 | | - noSortAlphabetically: false, |
98 | | - reservedFirst: true, |
99 | | - }, |
100 | | - ], |
101 | | - '@typescript-eslint/no-unused-vars': [ |
102 | | - 'error', |
103 | | - { |
104 | | - args: 'all', |
105 | | - argsIgnorePattern: '^_', |
106 | | - caughtErrors: 'all', |
107 | | - caughtErrorsIgnorePattern: '^_', |
108 | | - destructuredArrayIgnorePattern: '^_', |
109 | | - varsIgnorePattern: '^_', |
110 | | - ignoreRestSiblings: true, |
111 | | - }, |
112 | | - ], |
113 | | - 'react/sort-default-props': 'error', |
114 | | - 'unused-imports/no-unused-imports': 'error', |
115 | | - 'unused-imports/no-unused-vars': 'off', |
116 | | - 'comma-dangle': 'off', |
117 | | - 'react/prop-types': 'off', |
118 | | - 'no-console': [ |
119 | | - 'error', |
120 | | - { |
121 | | - allow: ['info', 'debug', 'warn', 'error'], |
122 | | - }, |
123 | | - ], |
124 | | - 'spaced-comment': [ |
125 | | - 'error', |
126 | | - 'always', |
127 | | - { |
128 | | - markers: ['/'], |
129 | | - }, |
130 | | - ], |
131 | | - '@devup/component-interface': 'error', |
132 | | - '@devup/app-page': 'error', |
133 | | - '@devup/component': 'error', |
134 | | - ...hooksPlugin.configs.recommended.rules, |
135 | | - 'react-hooks/exhaustive-deps': [ |
136 | | - 'warn', |
137 | | - { |
138 | | - additionalHooks: 'useSafeEffect', |
139 | | - }, |
140 | | - ], |
141 | | - '@typescript-eslint/no-unused-expressions': [ |
142 | | - 'error', |
143 | | - { |
144 | | - allowShortCircuit: true, |
145 | | - allowTernary: true, |
146 | | - }, |
147 | | - ], |
148 | | - }, |
149 | | - }, |
150 | | - { |
151 | | - files: ['**/*.test-d.{ts,tsx}'], |
152 | | - rules: { |
153 | | - '@typescript-eslint/no-unused-expressions': 'off', |
154 | | - }, |
155 | | - }, |
156 | | - // md, mdx rules |
157 | | - { |
158 | | - ...mdx.flat, |
159 | | - files: ['**/*.{md,mdx}'], |
160 | | - processor: mdx.createRemarkProcessor({ |
161 | | - lintCodeBlocks: true, |
162 | | - }), |
163 | | - }, |
164 | | - { |
165 | | - ...mdx.flatCodeBlocks, |
166 | | - files: ['**/*.{md,mdx}/*.{js,jsx,ts,tsx}'], |
167 | | - rules: { |
168 | | - ...mdx.flatCodeBlocks.rules, |
169 | | - 'react/jsx-no-undef': 'off', |
170 | | - 'react/jsx-tag-spacing': ['error', { beforeClosing: 'never' }], |
171 | | - 'no-empty-pattern': 'off', |
172 | | - '@typescript-eslint/no-empty-object-type': 'off', |
173 | | - }, |
174 | | - }, |
175 | | -] as Linter.Config[] |
| 1 | +import devupUiEslintPlugin from '@devup-ui/eslint-plugin' |
| 2 | +import js from '@eslint/js' |
| 3 | +import pluginQuery from '@tanstack/eslint-plugin-query' |
| 4 | +import type { Linter } from 'eslint' |
| 5 | +import * as mdx from 'eslint-plugin-mdx' |
| 6 | +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' |
| 7 | +// @ts-ignore |
| 8 | +import react from 'eslint-plugin-react' |
| 9 | +// @ts-ignore |
| 10 | +import hooksPlugin from 'eslint-plugin-react-hooks' |
| 11 | +import simpleImportSort from 'eslint-plugin-simple-import-sort' |
| 12 | +import unusedImports from 'eslint-plugin-unused-imports' |
| 13 | +import tseslint from 'typescript-eslint' |
| 14 | + |
| 15 | +import { appPage, component, componentInterface } from '../rules' |
| 16 | + |
| 17 | +export default [ |
| 18 | + { |
| 19 | + ignores: [ |
| 20 | + '**/node_modules/', |
| 21 | + '**/build/', |
| 22 | + '**/storybook-static/', |
| 23 | + '**/dist/', |
| 24 | + '**/next-env.d.ts', |
| 25 | + '**/out/', |
| 26 | + '**/public/', |
| 27 | + '**/df/', |
| 28 | + '**/coverage/', |
| 29 | + '**/target/', |
| 30 | + '**/venv/', |
| 31 | + '!**/src/**', |
| 32 | + '!vite.config.ts', |
| 33 | + '**/__snapshots__/', |
| 34 | + '**/.*/', |
| 35 | + ], |
| 36 | + }, |
| 37 | + ...devupUiEslintPlugin.configs.recommended, |
| 38 | + react.configs.flat!.recommended, |
| 39 | + js.configs.recommended, |
| 40 | + eslintPluginPrettierRecommended, |
| 41 | + ...tseslint.configs.recommended, |
| 42 | + ...pluginQuery.configs['flat/recommended'], |
| 43 | + { |
| 44 | + settings: { |
| 45 | + react: { |
| 46 | + version: 'detect', |
| 47 | + defaultVersion: '19', |
| 48 | + }, |
| 49 | + }, |
| 50 | + plugins: { |
| 51 | + 'react-hooks': hooksPlugin, |
| 52 | + 'unused-imports': unusedImports, |
| 53 | + 'simple-import-sort': simpleImportSort, |
| 54 | + '@devup': { |
| 55 | + rules: { |
| 56 | + component, |
| 57 | + 'app-page': appPage, |
| 58 | + 'component-interface': componentInterface, |
| 59 | + }, |
| 60 | + }, |
| 61 | + }, |
| 62 | + rules: { |
| 63 | + 'react/react-in-jsx-scope': 'off', |
| 64 | + 'require-jsdoc': 'off', |
| 65 | + 'valid-jsdoc': 'off', |
| 66 | + 'prettier/prettier': [ |
| 67 | + 'error', |
| 68 | + { |
| 69 | + endOfLine: 'auto', |
| 70 | + trailingComma: 'all', |
| 71 | + singleQuote: true, |
| 72 | + semi: false, |
| 73 | + }, |
| 74 | + ], |
| 75 | + 'no-trailing-spaces': 'error', |
| 76 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 77 | + '@typescript-eslint/no-explicit-any': 'off', |
| 78 | + '@typescript-eslint/no-var-requires': 'off', |
| 79 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 80 | + 'no-constant-condition': ['error', { checkLoops: false }], |
| 81 | + 'react/jsx-curly-brace-presence': 'error', |
| 82 | + camelcase: 'off', |
| 83 | + 'simple-import-sort/imports': 'error', |
| 84 | + 'simple-import-sort/exports': 'error', |
| 85 | + 'react/jsx-sort-props': [ |
| 86 | + 'error', |
| 87 | + { |
| 88 | + callbacksLast: false, |
| 89 | + shorthandFirst: false, |
| 90 | + shorthandLast: false, |
| 91 | + ignoreCase: false, |
| 92 | + noSortAlphabetically: false, |
| 93 | + reservedFirst: true, |
| 94 | + }, |
| 95 | + ], |
| 96 | + '@typescript-eslint/no-unused-vars': [ |
| 97 | + 'error', |
| 98 | + { |
| 99 | + args: 'all', |
| 100 | + argsIgnorePattern: '^_', |
| 101 | + caughtErrors: 'all', |
| 102 | + caughtErrorsIgnorePattern: '^_', |
| 103 | + destructuredArrayIgnorePattern: '^_', |
| 104 | + varsIgnorePattern: '^_', |
| 105 | + ignoreRestSiblings: true, |
| 106 | + }, |
| 107 | + ], |
| 108 | + 'react/sort-default-props': 'error', |
| 109 | + 'unused-imports/no-unused-imports': 'error', |
| 110 | + 'unused-imports/no-unused-vars': 'off', |
| 111 | + 'comma-dangle': 'off', |
| 112 | + 'react/prop-types': 'off', |
| 113 | + 'no-console': [ |
| 114 | + 'error', |
| 115 | + { |
| 116 | + allow: ['info', 'debug', 'warn', 'error'], |
| 117 | + }, |
| 118 | + ], |
| 119 | + 'spaced-comment': [ |
| 120 | + 'error', |
| 121 | + 'always', |
| 122 | + { |
| 123 | + markers: ['/'], |
| 124 | + }, |
| 125 | + ], |
| 126 | + '@devup/component-interface': 'error', |
| 127 | + '@devup/app-page': 'error', |
| 128 | + '@devup/component': 'error', |
| 129 | + ...hooksPlugin.configs.recommended.rules, |
| 130 | + 'react-hooks/exhaustive-deps': [ |
| 131 | + 'warn', |
| 132 | + { |
| 133 | + additionalHooks: 'useSafeEffect', |
| 134 | + }, |
| 135 | + ], |
| 136 | + '@typescript-eslint/no-unused-expressions': [ |
| 137 | + 'error', |
| 138 | + { |
| 139 | + allowShortCircuit: true, |
| 140 | + allowTernary: true, |
| 141 | + }, |
| 142 | + ], |
| 143 | + }, |
| 144 | + }, |
| 145 | + { |
| 146 | + files: ['**/*.test-d.{ts,tsx}'], |
| 147 | + rules: { |
| 148 | + '@typescript-eslint/no-unused-expressions': 'off', |
| 149 | + }, |
| 150 | + }, |
| 151 | + // md, mdx rules |
| 152 | + { |
| 153 | + ...mdx.flat, |
| 154 | + files: ['**/*.{md,mdx}'], |
| 155 | + processor: mdx.createRemarkProcessor({ |
| 156 | + lintCodeBlocks: true, |
| 157 | + }), |
| 158 | + }, |
| 159 | + { |
| 160 | + ...mdx.flatCodeBlocks, |
| 161 | + files: ['**/*.{md,mdx}/*.{js,jsx,ts,tsx}'], |
| 162 | + rules: { |
| 163 | + ...mdx.flatCodeBlocks.rules, |
| 164 | + 'react/jsx-no-undef': 'off', |
| 165 | + 'react/jsx-tag-spacing': ['error', { beforeClosing: 'never' }], |
| 166 | + 'no-empty-pattern': 'off', |
| 167 | + '@typescript-eslint/no-empty-object-type': 'off', |
| 168 | + }, |
| 169 | + }, |
| 170 | +] as Linter.Config[] |
0 commit comments