@coko/lint 3.0.0-alpha.18 → 3.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +2 -1
- package/src/eslint.mjs +114 -90
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [3.0.0-alpha.19](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.18...v3.0.0-alpha.19) (2026-01-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **eslint:** add client config ([ac6878a](https://gitlab.coko.foundation/cokoapps/lint/commit/ac6878ae6f3934eccdb0d48c4a39331311fe6ce2))
|
|
11
|
+
|
|
5
12
|
## [3.0.0-alpha.18](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.17...v3.0.0-alpha.18) (2026-01-20)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coko/lint",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.19",
|
|
4
4
|
"description": "Linter configurations and dependencies for coko's projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lint",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"chalk": "^5.6.2",
|
|
46
46
|
"commander": "^14.0.2",
|
|
47
47
|
"commitizen": "^4.3.1",
|
|
48
|
+
"confusing-browser-globals": "^1.0.11",
|
|
48
49
|
"conventional-commit-types": "^3.0.0",
|
|
49
50
|
"cz-conventional-changelog": "^3.3.0",
|
|
50
51
|
"cz-customizable": "^7.5.1",
|
package/src/eslint.mjs
CHANGED
|
@@ -3,12 +3,17 @@ import js from '@eslint/js'
|
|
|
3
3
|
|
|
4
4
|
import globals from 'globals'
|
|
5
5
|
import tseslint from 'typescript-eslint'
|
|
6
|
-
|
|
6
|
+
import importPlugin from 'eslint-plugin-import'
|
|
7
|
+
import workspaces from 'eslint-plugin-workspaces'
|
|
7
8
|
|
|
8
9
|
import nodePlugin from 'eslint-plugin-n'
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
import react from 'eslint-plugin-react'
|
|
12
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
13
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y'
|
|
14
|
+
import confusingBrowserGlobals from 'confusing-browser-globals'
|
|
15
|
+
|
|
10
16
|
import vitest from '@vitest/eslint-plugin'
|
|
11
|
-
import workspaces from 'eslint-plugin-workspaces'
|
|
12
17
|
// import jest from 'eslint-plugin-jest'
|
|
13
18
|
// import cypressPlugin from 'eslint-plugin-cypress'
|
|
14
19
|
|
|
@@ -19,17 +24,8 @@ import workspaces from 'eslint-plugin-workspaces'
|
|
|
19
24
|
* jest
|
|
20
25
|
* cypress
|
|
21
26
|
*
|
|
22
|
-
* => client
|
|
23
|
-
* no console
|
|
24
|
-
* jsx a11y
|
|
25
|
-
* airbnb react
|
|
26
|
-
* react recommended
|
|
27
|
-
* react hooks
|
|
28
|
-
* confusing-browser-globals
|
|
29
|
-
*
|
|
30
27
|
* => drop dependencies
|
|
31
28
|
* airbnb
|
|
32
|
-
* @eslint/eslintrc (if not using flat compat)
|
|
33
29
|
* babel eslint parser
|
|
34
30
|
*
|
|
35
31
|
*/
|
|
@@ -156,17 +152,75 @@ const commonRules = {
|
|
|
156
152
|
'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }],
|
|
157
153
|
}
|
|
158
154
|
|
|
155
|
+
const workspacesConfig = {
|
|
156
|
+
plugins: { workspaces },
|
|
157
|
+
rules: {
|
|
158
|
+
'workspaces/no-relative-imports': 'error',
|
|
159
|
+
'workspaces/require-dependency': 'warn',
|
|
160
|
+
},
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const typescriptConfig = {
|
|
164
|
+
files: ['**/*.{ts,tsx}'],
|
|
165
|
+
languageOptions: {
|
|
166
|
+
parser: tseslint.parser,
|
|
167
|
+
},
|
|
168
|
+
plugins: {
|
|
169
|
+
'@typescript-eslint': tseslint.plugin,
|
|
170
|
+
},
|
|
171
|
+
rules: {
|
|
172
|
+
...tseslint.configs.recommended.rules,
|
|
173
|
+
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
174
|
+
|
|
175
|
+
'no-redeclare': 'off',
|
|
176
|
+
'@typescript-eslint/no-redeclare': 'error',
|
|
177
|
+
|
|
178
|
+
'no-unused-vars': 'off',
|
|
179
|
+
'@typescript-eslint/no-unused-vars': [
|
|
180
|
+
'error',
|
|
181
|
+
{
|
|
182
|
+
argsIgnorePattern: '^_',
|
|
183
|
+
varsIgnorePattern: '^_',
|
|
184
|
+
caughtErrorsIgnorePattern: '^_',
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
|
+
},
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const viteConfig = {
|
|
191
|
+
files: ['**/__tests__/**/*.test.ts'],
|
|
192
|
+
plugins: {
|
|
193
|
+
vitest,
|
|
194
|
+
},
|
|
195
|
+
// settings: {
|
|
196
|
+
// vitest: {
|
|
197
|
+
// typecheck: true,
|
|
198
|
+
// },
|
|
199
|
+
// },
|
|
200
|
+
rules: {
|
|
201
|
+
...vitest.configs.recommended.rules,
|
|
202
|
+
'vitest/no-focused-tests': ['error', { fixable: false }],
|
|
203
|
+
},
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const globalIgnoreList = [
|
|
207
|
+
'**/_build',
|
|
208
|
+
'**/dist',
|
|
209
|
+
'**/docs',
|
|
210
|
+
'!**/.storybook',
|
|
211
|
+
'!**/.commitlintrc.js',
|
|
212
|
+
'!**/.cz-config.js',
|
|
213
|
+
'!**/.jest.config.js',
|
|
214
|
+
'!**/.lintstagedrc.js',
|
|
215
|
+
'!**/.prettierrc.js',
|
|
216
|
+
'!**/.stylelintrc.js',
|
|
217
|
+
'**/node_modules',
|
|
218
|
+
]
|
|
219
|
+
|
|
159
220
|
const server = [
|
|
160
221
|
js.configs.recommended,
|
|
161
222
|
importPlugin.flatConfigs.recommended,
|
|
162
|
-
|
|
163
|
-
{
|
|
164
|
-
plugins: { workspaces },
|
|
165
|
-
rules: {
|
|
166
|
-
'workspaces/no-relative-imports': 'error',
|
|
167
|
-
'workspaces/require-dependency': 'warn',
|
|
168
|
-
},
|
|
169
|
-
},
|
|
223
|
+
workspacesConfig,
|
|
170
224
|
|
|
171
225
|
{
|
|
172
226
|
files: ['**/*.{js,mjs,ts}'],
|
|
@@ -203,28 +257,6 @@ const server = [
|
|
|
203
257
|
},
|
|
204
258
|
},
|
|
205
259
|
|
|
206
|
-
// {
|
|
207
|
-
// files: ['**/*.mjs', '**/*.ts'],
|
|
208
|
-
// languageOptions: {
|
|
209
|
-
// sourceType: 'module',
|
|
210
|
-
// },
|
|
211
|
-
// rules: {
|
|
212
|
-
// // 'no-restricted-globals': [
|
|
213
|
-
// // 'error',
|
|
214
|
-
// // {
|
|
215
|
-
// // name: '__dirname',
|
|
216
|
-
// // message:
|
|
217
|
-
// // 'Do not use __dirname; use import.meta.url or process.cwd().',
|
|
218
|
-
// // },
|
|
219
|
-
// // {
|
|
220
|
-
// // name: '__filename',
|
|
221
|
-
// // message:
|
|
222
|
-
// // 'Do not use __filename in ES modules or TypeScript; use import.meta.url or path.resolve() instead.',
|
|
223
|
-
// // },
|
|
224
|
-
// // ],
|
|
225
|
-
// },
|
|
226
|
-
// },
|
|
227
|
-
|
|
228
260
|
{
|
|
229
261
|
files: ['**/*.mjs'],
|
|
230
262
|
rules: {
|
|
@@ -232,62 +264,54 @@ const server = [
|
|
|
232
264
|
},
|
|
233
265
|
},
|
|
234
266
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
},
|
|
240
|
-
plugins: {
|
|
241
|
-
'@typescript-eslint': tseslint.plugin,
|
|
242
|
-
},
|
|
243
|
-
rules: {
|
|
244
|
-
...tseslint.configs.recommended.rules,
|
|
245
|
-
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
267
|
+
typescriptConfig,
|
|
268
|
+
viteConfig,
|
|
269
|
+
globalIgnores(globalIgnoreList),
|
|
270
|
+
]
|
|
246
271
|
|
|
247
|
-
|
|
248
|
-
|
|
272
|
+
const client = [
|
|
273
|
+
js.configs.recommended,
|
|
274
|
+
importPlugin.flatConfigs.recommended,
|
|
275
|
+
workspacesConfig,
|
|
276
|
+
react.configs.flat.recommended,
|
|
277
|
+
react.configs.flat['jsx-runtime'],
|
|
278
|
+
reactHooks.configs.flat.recommended,
|
|
279
|
+
jsxA11y.flatConfigs.recommended,
|
|
249
280
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
281
|
+
{
|
|
282
|
+
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
|
|
283
|
+
languageOptions: {
|
|
284
|
+
globals: { ...globals.browser },
|
|
285
|
+
ecmaVersion: 'latest',
|
|
286
|
+
parserOptions: {
|
|
287
|
+
ecmaFeatures: {
|
|
288
|
+
jsx: true,
|
|
257
289
|
},
|
|
258
|
-
|
|
290
|
+
},
|
|
259
291
|
},
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
292
|
+
settings: {
|
|
293
|
+
'import/resolver': {
|
|
294
|
+
typescript: {
|
|
295
|
+
alwaysTryTypes: true,
|
|
296
|
+
},
|
|
297
|
+
},
|
|
266
298
|
},
|
|
267
|
-
// settings: {
|
|
268
|
-
// vitest: {
|
|
269
|
-
// typecheck: true,
|
|
270
|
-
// },
|
|
271
|
-
// },
|
|
272
299
|
rules: {
|
|
273
|
-
...
|
|
274
|
-
'
|
|
300
|
+
...commonRules,
|
|
301
|
+
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
302
|
+
'import/no-unresolved': 'error',
|
|
303
|
+
'react/jsx-sort-props': [1, { ignoreCase: true }],
|
|
304
|
+
'no-restricted-globals': ['error'].concat(confusingBrowserGlobals),
|
|
275
305
|
},
|
|
276
306
|
},
|
|
277
307
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
'**/docs',
|
|
282
|
-
'!**/.storybook',
|
|
283
|
-
'!**/.commitlintrc.js',
|
|
284
|
-
'!**/.cz-config.js',
|
|
285
|
-
'!**/.jest.config.js',
|
|
286
|
-
'!**/.lintstagedrc.js',
|
|
287
|
-
'!**/.prettierrc.js',
|
|
288
|
-
'!**/.stylelintrc.js',
|
|
289
|
-
'**/node_modules',
|
|
290
|
-
]),
|
|
308
|
+
typescriptConfig,
|
|
309
|
+
viteConfig,
|
|
310
|
+
globalIgnores(globalIgnoreList),
|
|
291
311
|
]
|
|
292
312
|
|
|
293
|
-
export {
|
|
313
|
+
export {
|
|
314
|
+
defineConfig as defineEslintConfig,
|
|
315
|
+
server as serverEslintConfig,
|
|
316
|
+
client as createClientConfig,
|
|
317
|
+
}
|