@coko/lint 3.0.0-alpha.3 → 3.0.0-alpha.6

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 CHANGED
@@ -2,6 +2,22 @@
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.6](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2025-11-06)
6
+
7
+
8
+ ### Features
9
+
10
+ * **eslint:** add vitest plugin ([92a0f86](https://gitlab.coko.foundation/cokoapps/lint/commit/92a0f864f91b7a67b4c65de841757223290e1b63))
11
+
12
+ ## [3.0.0-alpha.5](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2025-11-06)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **eslint:** refine new eslint rules ([caca5f4](https://gitlab.coko.foundation/cokoapps/lint/commit/caca5f45e743725ce259704328a85c7791d33f6f))
18
+
19
+ ## [3.0.0-alpha.4](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2025-11-06)
20
+
5
21
  ## [3.0.0-alpha.3](https://gitlab.coko.foundation/cokoapps/lint/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2025-10-24)
6
22
 
7
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coko/lint",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.6",
4
4
  "description": "Linter configurations and dependencies for coko's projects",
5
5
  "keywords": [
6
6
  "lint",
@@ -42,6 +42,7 @@
42
42
  "@commitlint/config-conventional": "^20.0.0",
43
43
  "@eslint/eslintrc": "^3.3.1",
44
44
  "@eslint/js": "^9.38.0",
45
+ "@vitest/eslint-plugin": "^1.4.1",
45
46
  "commander": "^14.0.1",
46
47
  "commitizen": "^4.3.1",
47
48
  "conventional-commit-types": "^3.0.0",
package/src/eslint.mjs CHANGED
@@ -10,6 +10,7 @@ import tseslint from 'typescript-eslint'
10
10
 
11
11
  import nodePlugin from 'eslint-plugin-n'
12
12
  import importPlugin from 'eslint-plugin-import'
13
+ import vitest from '@vitest/eslint-plugin'
13
14
  // import jest from 'eslint-plugin-jest'
14
15
  // import cypressPlugin from 'eslint-plugin-cypress'
15
16
 
@@ -87,7 +88,6 @@ const commonRules = {
87
88
  'no-template-curly-in-string': 'warn',
88
89
  'no-throw-literal': 'error',
89
90
  'no-undef-init': 'warn',
90
- 'no-undefined': 'error',
91
91
  'no-unneeded-ternary': ['error', { defaultAssignment: false }],
92
92
  'no-unused-expressions': 'error',
93
93
  'no-useless-computed-key': 'error',
@@ -121,24 +121,41 @@ const commonRules = {
121
121
  // storybook
122
122
  '.storybook/*',
123
123
  '**/stories/**/*.js',
124
+ '**/stories/**/*.ts',
124
125
 
125
126
  // tests
126
127
  'cypress/**',
127
128
  '**/*.spec.js',
129
+ '**/*.spec.ts',
128
130
  '**/*.test.js',
131
+ '**/*.test.ts',
129
132
  '**/__tests__/**/*',
133
+ '**/vitest.config.*',
130
134
 
131
135
  // webpack
132
136
  'webpack/**',
133
137
 
134
138
  // configs
135
139
  '.commitlintrc.js',
140
+ '.commitlintrc.ts',
141
+ '.commitlintrc.mjs',
136
142
  '.cz-config.js',
143
+ '.cz-config.ts',
144
+ '.cz-config.mjs',
137
145
  '.jest.config.js',
146
+ '.jest.config.ts',
147
+ '.jest.config.mjs',
138
148
  '.lintstagedrc.js',
149
+ '.lintstagedrc.ts',
150
+ '.lintstagedrc.mjs',
139
151
  '.prettierrc.js',
152
+ '.prettierrc.ts',
153
+ '.prettierrc.mjs',
140
154
  '.stylelintrc.js',
155
+ '.stylelintrc.ts',
156
+ '.stylelintrc.mjs',
141
157
  'eslint.config.js',
158
+ 'eslint.config.ts',
142
159
  'eslint.config.mjs',
143
160
 
144
161
  // other
@@ -175,6 +192,7 @@ const server = [
175
192
  rules: {
176
193
  ...commonRules,
177
194
  'no-console': 'error',
195
+ // 'n/no-process-exit': 'off',
178
196
  'import/no-unresolved': ['error', { commonjs: true }],
179
197
  },
180
198
  },
@@ -189,27 +207,27 @@ const server = [
189
207
  },
190
208
  },
191
209
 
192
- {
193
- files: ['**/*.mjs', '**/*.ts'],
194
- languageOptions: {
195
- sourceType: 'module',
196
- },
197
- rules: {
198
- 'no-restricted-globals': [
199
- 'error',
200
- {
201
- name: '__dirname',
202
- message:
203
- 'Do not use __dirname; use import.meta.url or process.cwd().',
204
- },
205
- {
206
- name: '__filename',
207
- message:
208
- 'Do not use __filename in ES modules or TypeScript; use import.meta.url or path.resolve() instead.',
209
- },
210
- ],
211
- },
212
- },
210
+ // {
211
+ // files: ['**/*.mjs', '**/*.ts'],
212
+ // languageOptions: {
213
+ // sourceType: 'module',
214
+ // },
215
+ // rules: {
216
+ // // 'no-restricted-globals': [
217
+ // // 'error',
218
+ // // {
219
+ // // name: '__dirname',
220
+ // // message:
221
+ // // 'Do not use __dirname; use import.meta.url or process.cwd().',
222
+ // // },
223
+ // // {
224
+ // // name: '__filename',
225
+ // // message:
226
+ // // 'Do not use __filename in ES modules or TypeScript; use import.meta.url or path.resolve() instead.',
227
+ // // },
228
+ // // ],
229
+ // },
230
+ // },
213
231
 
214
232
  {
215
233
  files: ['**/*.mjs'],
@@ -229,6 +247,27 @@ const server = [
229
247
  rules: {
230
248
  ...tseslint.configs.recommended.rules,
231
249
  '@typescript-eslint/explicit-function-return-type': 'error',
250
+
251
+ 'no-redeclare': 'off',
252
+ '@typescript-eslint/no-redeclare': 'error',
253
+
254
+ 'no-unused-vars': 'off',
255
+ '@typescript-eslint/no-unused-vars': 'error',
256
+ },
257
+ },
258
+
259
+ {
260
+ files: ['**/__tests__/**/*.test.ts'],
261
+ plugins: {
262
+ vitest,
263
+ },
264
+ settings: {
265
+ vitest: {
266
+ typecheck: true,
267
+ },
268
+ },
269
+ rules: {
270
+ ...vitest.configs.recommended.rules,
232
271
  },
233
272
  },
234
273