@kouts/eslint-config 1.1.0 → 1.3.0

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/README.md CHANGED
@@ -25,29 +25,36 @@ export default [
25
25
  ...config(),
26
26
  {
27
27
  // Add custom rules here
28
- }
28
+ },
29
29
  ]
30
30
  ```
31
31
 
32
32
  #### Customizing the config
33
33
 
34
- You can customize the config by passing an object to the `config` function:
35
-
36
- ```javascript
37
- config({
38
- ts: true,
39
- vue: true
40
- vueVersion: 3
41
- })
42
- ```
34
+ The configuration comes with default settings that extend the [neostandard config](https://github.com/neostandard/neostandard/tree/main?tab=readme-ov-file#configuration-options) config. You can further customize it by passing an object to the `config` function:
43
35
 
44
- **Available options:**
36
+ **Config settings defaults:**
45
37
 
46
38
  | Option | Type | Description | Default |
47
39
  | ---------- | ---------- | ----------------------------- | ------- |
48
40
  | ts | `boolean` | Enable TypeScript support | `true` |
41
+ | noJsx | `boolean` | No jsx rules will be added | `true` |
42
+ | noStyle | `boolean` | No style rules will be added | `true` |
43
+ | semi | `boolean` | No semicolons | `false` |
49
44
  | vue | `boolean` | Enable Vue.js support | `true` |
50
45
  | vueVersion | `2` or `3` | Specify the version of Vue.js | `3` |
46
+ | vitest | `boolean` | Enable Vitest support | `true` |
47
+
48
+ **Example:**
49
+
50
+ ```javascript
51
+ config({
52
+ ts: false,
53
+ vue: true
54
+ vueVersion: 3,
55
+ vitest: false,
56
+ })
57
+ ```
51
58
 
52
59
  ### Prettier config
53
60
 
@@ -102,6 +109,7 @@ Ad the following settings to your VS Code project settings for autofix on save:
102
109
  - [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier) for using Prettier as a code formatter with `eslint --fix`
103
110
  - [eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort) for auto-fixing imports order
104
111
  - [eslint-plugin-import-x](https://github.com/lydell/eslint-plugin-simple-import-sort) for auto-fixing import/export syntax, and prevent issues with misspelling of file paths and import names
112
+ - [eslint-plugin-vitest](https://github.com/vitest-dev/eslint-plugin-vitest) for linting Vitest test files
105
113
 
106
114
  ## License
107
115
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@kouts/eslint-config",
3
3
  "type": "module",
4
- "version": "1.1.0",
5
- "packageManager": "pnpm@9.7.0",
4
+ "version": "1.3.0",
5
+ "packageManager": "pnpm@9.7.1",
6
6
  "engines": {
7
7
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
8
8
  },
9
- "author": "kouts",
9
+ "author": "Giannis Koutsaftakis",
10
10
  "license": "MIT",
11
11
  "bugs": {
12
12
  "url": "https://github.com/kouts/eslint-config/issues"
@@ -47,7 +47,8 @@
47
47
  "inspect": "npx @eslint/config-inspector --config eslint.config.ts",
48
48
  "test": "echo \"Error: no test specified\" && exit 1",
49
49
  "lint": "pnpm run build && eslint .",
50
- "lint-fix": "pnpm run build && eslint --fix ."
50
+ "lint-fix": "pnpm run build && eslint --fix .",
51
+ "prepare": "husky"
51
52
  },
52
53
  "keywords": [
53
54
  "lint",
@@ -68,6 +69,7 @@
68
69
  "url": "git+https://github.com/kouts/eslint-config.git"
69
70
  },
70
71
  "dependencies": {
72
+ "@vitest/eslint-plugin": "^1.0.3",
71
73
  "eslint-config-prettier": "^9.1.0",
72
74
  "eslint-plugin-html": "^8.1.1",
73
75
  "eslint-plugin-import-x": "^3.1.0",
@@ -78,15 +80,22 @@
78
80
  "prettier": "^3.3.3"
79
81
  },
80
82
  "devDependencies": {
81
- "@types/node": "^22.2.0",
83
+ "@commitlint/cli": "^19.4.0",
84
+ "@commitlint/config-conventional": "^19.2.2",
85
+ "@semantic-release/changelog": "^6.0.3",
86
+ "@semantic-release/git": "^10.0.1",
87
+ "@types/node": "^22.4.0",
82
88
  "eslint": "^9.9.0",
89
+ "husky": "^9.1.4",
90
+ "lint-staged": "^15.2.9",
83
91
  "pkgroll": "^2.4.2",
92
+ "semantic-release": "^24.1.0",
84
93
  "typescript": "^5.5.4"
85
94
  },
86
95
  "peerDependencies": {
87
96
  "eslint": "^9.8.0"
88
97
  },
89
98
  "resolutions": {
90
- "@typescript-eslint/utils": "^8.0.0"
99
+ "@typescript-eslint/utils": "^8.1.0"
91
100
  }
92
- }
101
+ }
package/dist/index.cjs DELETED
@@ -1,528 +0,0 @@
1
- 'use strict';
2
-
3
- var pluginHtml = require('eslint-plugin-html');
4
- var pluginImport = require('eslint-plugin-import-x');
5
- var pluginPrettier = require('eslint-plugin-prettier/recommended');
6
- var pluginSimpleImportSort = require('eslint-plugin-simple-import-sort');
7
- var neostandard = require('neostandard');
8
- var pluginVue = require('eslint-plugin-vue');
9
-
10
- function getDefaultExportFromCjs (x) {
11
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
12
- }
13
-
14
- /*
15
- * WARNING: This file is autogenerated using the tools/update-eslint-all.js
16
- * script. Do not edit manually.
17
- */
18
-
19
- /* eslint quote-props: off -- autogenerated so don't lint */
20
-
21
- /*
22
- * IMPORTANT!
23
- *
24
- * We cannot add a "name" property to this object because it's still used in eslintrc
25
- * which doesn't support the "name" property. If we add a "name" property, it will
26
- * cause an error.
27
- */
28
-
29
- var eslintAll = Object.freeze({
30
- "rules": {
31
- "accessor-pairs": "error",
32
- "array-callback-return": "error",
33
- "arrow-body-style": "error",
34
- "block-scoped-var": "error",
35
- "camelcase": "error",
36
- "capitalized-comments": "error",
37
- "class-methods-use-this": "error",
38
- "complexity": "error",
39
- "consistent-return": "error",
40
- "consistent-this": "error",
41
- "constructor-super": "error",
42
- "curly": "error",
43
- "default-case": "error",
44
- "default-case-last": "error",
45
- "default-param-last": "error",
46
- "dot-notation": "error",
47
- "eqeqeq": "error",
48
- "for-direction": "error",
49
- "func-name-matching": "error",
50
- "func-names": "error",
51
- "func-style": "error",
52
- "getter-return": "error",
53
- "grouped-accessor-pairs": "error",
54
- "guard-for-in": "error",
55
- "id-denylist": "error",
56
- "id-length": "error",
57
- "id-match": "error",
58
- "init-declarations": "error",
59
- "logical-assignment-operators": "error",
60
- "max-classes-per-file": "error",
61
- "max-depth": "error",
62
- "max-lines": "error",
63
- "max-lines-per-function": "error",
64
- "max-nested-callbacks": "error",
65
- "max-params": "error",
66
- "max-statements": "error",
67
- "new-cap": "error",
68
- "no-alert": "error",
69
- "no-array-constructor": "error",
70
- "no-async-promise-executor": "error",
71
- "no-await-in-loop": "error",
72
- "no-bitwise": "error",
73
- "no-caller": "error",
74
- "no-case-declarations": "error",
75
- "no-class-assign": "error",
76
- "no-compare-neg-zero": "error",
77
- "no-cond-assign": "error",
78
- "no-console": "error",
79
- "no-const-assign": "error",
80
- "no-constant-binary-expression": "error",
81
- "no-constant-condition": "error",
82
- "no-constructor-return": "error",
83
- "no-continue": "error",
84
- "no-control-regex": "error",
85
- "no-debugger": "error",
86
- "no-delete-var": "error",
87
- "no-div-regex": "error",
88
- "no-dupe-args": "error",
89
- "no-dupe-class-members": "error",
90
- "no-dupe-else-if": "error",
91
- "no-dupe-keys": "error",
92
- "no-duplicate-case": "error",
93
- "no-duplicate-imports": "error",
94
- "no-else-return": "error",
95
- "no-empty": "error",
96
- "no-empty-character-class": "error",
97
- "no-empty-function": "error",
98
- "no-empty-pattern": "error",
99
- "no-empty-static-block": "error",
100
- "no-eq-null": "error",
101
- "no-eval": "error",
102
- "no-ex-assign": "error",
103
- "no-extend-native": "error",
104
- "no-extra-bind": "error",
105
- "no-extra-boolean-cast": "error",
106
- "no-extra-label": "error",
107
- "no-fallthrough": "error",
108
- "no-func-assign": "error",
109
- "no-global-assign": "error",
110
- "no-implicit-coercion": "error",
111
- "no-implicit-globals": "error",
112
- "no-implied-eval": "error",
113
- "no-import-assign": "error",
114
- "no-inline-comments": "error",
115
- "no-inner-declarations": "error",
116
- "no-invalid-regexp": "error",
117
- "no-invalid-this": "error",
118
- "no-irregular-whitespace": "error",
119
- "no-iterator": "error",
120
- "no-label-var": "error",
121
- "no-labels": "error",
122
- "no-lone-blocks": "error",
123
- "no-lonely-if": "error",
124
- "no-loop-func": "error",
125
- "no-loss-of-precision": "error",
126
- "no-magic-numbers": "error",
127
- "no-misleading-character-class": "error",
128
- "no-multi-assign": "error",
129
- "no-multi-str": "error",
130
- "no-negated-condition": "error",
131
- "no-nested-ternary": "error",
132
- "no-new": "error",
133
- "no-new-func": "error",
134
- "no-new-native-nonconstructor": "error",
135
- "no-new-wrappers": "error",
136
- "no-nonoctal-decimal-escape": "error",
137
- "no-obj-calls": "error",
138
- "no-object-constructor": "error",
139
- "no-octal": "error",
140
- "no-octal-escape": "error",
141
- "no-param-reassign": "error",
142
- "no-plusplus": "error",
143
- "no-promise-executor-return": "error",
144
- "no-proto": "error",
145
- "no-prototype-builtins": "error",
146
- "no-redeclare": "error",
147
- "no-regex-spaces": "error",
148
- "no-restricted-exports": "error",
149
- "no-restricted-globals": "error",
150
- "no-restricted-imports": "error",
151
- "no-restricted-properties": "error",
152
- "no-restricted-syntax": "error",
153
- "no-return-assign": "error",
154
- "no-script-url": "error",
155
- "no-self-assign": "error",
156
- "no-self-compare": "error",
157
- "no-sequences": "error",
158
- "no-setter-return": "error",
159
- "no-shadow": "error",
160
- "no-shadow-restricted-names": "error",
161
- "no-sparse-arrays": "error",
162
- "no-template-curly-in-string": "error",
163
- "no-ternary": "error",
164
- "no-this-before-super": "error",
165
- "no-throw-literal": "error",
166
- "no-undef": "error",
167
- "no-undef-init": "error",
168
- "no-undefined": "error",
169
- "no-underscore-dangle": "error",
170
- "no-unexpected-multiline": "error",
171
- "no-unmodified-loop-condition": "error",
172
- "no-unneeded-ternary": "error",
173
- "no-unreachable": "error",
174
- "no-unreachable-loop": "error",
175
- "no-unsafe-finally": "error",
176
- "no-unsafe-negation": "error",
177
- "no-unsafe-optional-chaining": "error",
178
- "no-unused-expressions": "error",
179
- "no-unused-labels": "error",
180
- "no-unused-private-class-members": "error",
181
- "no-unused-vars": "error",
182
- "no-use-before-define": "error",
183
- "no-useless-assignment": "error",
184
- "no-useless-backreference": "error",
185
- "no-useless-call": "error",
186
- "no-useless-catch": "error",
187
- "no-useless-computed-key": "error",
188
- "no-useless-concat": "error",
189
- "no-useless-constructor": "error",
190
- "no-useless-escape": "error",
191
- "no-useless-rename": "error",
192
- "no-useless-return": "error",
193
- "no-var": "error",
194
- "no-void": "error",
195
- "no-warning-comments": "error",
196
- "no-with": "error",
197
- "object-shorthand": "error",
198
- "one-var": "error",
199
- "operator-assignment": "error",
200
- "prefer-arrow-callback": "error",
201
- "prefer-const": "error",
202
- "prefer-destructuring": "error",
203
- "prefer-exponentiation-operator": "error",
204
- "prefer-named-capture-group": "error",
205
- "prefer-numeric-literals": "error",
206
- "prefer-object-has-own": "error",
207
- "prefer-object-spread": "error",
208
- "prefer-promise-reject-errors": "error",
209
- "prefer-regex-literals": "error",
210
- "prefer-rest-params": "error",
211
- "prefer-spread": "error",
212
- "prefer-template": "error",
213
- "radix": "error",
214
- "require-atomic-updates": "error",
215
- "require-await": "error",
216
- "require-unicode-regexp": "error",
217
- "require-yield": "error",
218
- "sort-imports": "error",
219
- "sort-keys": "error",
220
- "sort-vars": "error",
221
- "strict": "error",
222
- "symbol-description": "error",
223
- "unicode-bom": "error",
224
- "use-isnan": "error",
225
- "valid-typeof": "error",
226
- "vars-on-top": "error",
227
- "yoda": "error"
228
- }
229
- });
230
-
231
- /**
232
- * @fileoverview Configuration applied when a user configuration extends from
233
- * eslint:recommended.
234
- * @author Nicholas C. Zakas
235
- */
236
-
237
- /* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
238
-
239
- /*
240
- * IMPORTANT!
241
- *
242
- * We cannot add a "name" property to this object because it's still used in eslintrc
243
- * which doesn't support the "name" property. If we add a "name" property, it will
244
- * cause an error.
245
- */
246
-
247
- var eslintRecommended = Object.freeze({
248
- rules: Object.freeze({
249
- "constructor-super": "error",
250
- "for-direction": "error",
251
- "getter-return": "error",
252
- "no-async-promise-executor": "error",
253
- "no-case-declarations": "error",
254
- "no-class-assign": "error",
255
- "no-compare-neg-zero": "error",
256
- "no-cond-assign": "error",
257
- "no-const-assign": "error",
258
- "no-constant-binary-expression": "error",
259
- "no-constant-condition": "error",
260
- "no-control-regex": "error",
261
- "no-debugger": "error",
262
- "no-delete-var": "error",
263
- "no-dupe-args": "error",
264
- "no-dupe-class-members": "error",
265
- "no-dupe-else-if": "error",
266
- "no-dupe-keys": "error",
267
- "no-duplicate-case": "error",
268
- "no-empty": "error",
269
- "no-empty-character-class": "error",
270
- "no-empty-pattern": "error",
271
- "no-empty-static-block": "error",
272
- "no-ex-assign": "error",
273
- "no-extra-boolean-cast": "error",
274
- "no-fallthrough": "error",
275
- "no-func-assign": "error",
276
- "no-global-assign": "error",
277
- "no-import-assign": "error",
278
- "no-invalid-regexp": "error",
279
- "no-irregular-whitespace": "error",
280
- "no-loss-of-precision": "error",
281
- "no-misleading-character-class": "error",
282
- "no-new-native-nonconstructor": "error",
283
- "no-nonoctal-decimal-escape": "error",
284
- "no-obj-calls": "error",
285
- "no-octal": "error",
286
- "no-prototype-builtins": "error",
287
- "no-redeclare": "error",
288
- "no-regex-spaces": "error",
289
- "no-self-assign": "error",
290
- "no-setter-return": "error",
291
- "no-shadow-restricted-names": "error",
292
- "no-sparse-arrays": "error",
293
- "no-this-before-super": "error",
294
- "no-undef": "error",
295
- "no-unexpected-multiline": "error",
296
- "no-unreachable": "error",
297
- "no-unsafe-finally": "error",
298
- "no-unsafe-negation": "error",
299
- "no-unsafe-optional-chaining": "error",
300
- "no-unused-labels": "error",
301
- "no-unused-private-class-members": "error",
302
- "no-unused-vars": "error",
303
- "no-useless-backreference": "error",
304
- "no-useless-catch": "error",
305
- "no-useless-escape": "error",
306
- "no-with": "error",
307
- "require-yield": "error",
308
- "use-isnan": "error",
309
- "valid-typeof": "error"
310
- })
311
- });
312
-
313
- /**
314
- * @fileoverview Main package entrypoint.
315
- * @author Nicholas C. Zakas
316
- */
317
-
318
- //------------------------------------------------------------------------------
319
- // Public Interface
320
- //------------------------------------------------------------------------------
321
-
322
- var src = {
323
- configs: {
324
- all: eslintAll,
325
- recommended: eslintRecommended
326
- }
327
- };
328
-
329
- var js = /*@__PURE__*/getDefaultExportFromCjs(src);
330
-
331
- const typescript = [
332
- ...neostandard.plugins["typescript-eslint"].configs.recommended,
333
- {
334
- name: "kouts/typescript",
335
- rules: {
336
- // Prefer T[] instead of Array<T>
337
- "@typescript-eslint/array-type": ["error", { default: "array" }],
338
- // Prefer type over interface for objects
339
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
340
- // Fix type imports
341
- "@typescript-eslint/consistent-type-imports": [
342
- "error",
343
- {
344
- prefer: "type-imports",
345
- fixStyle: "inline-type-imports"
346
- }
347
- ],
348
- // Allow _ for unused variables
349
- "@typescript-eslint/no-unused-vars": [
350
- "error",
351
- {
352
- args: "none",
353
- caughtErrors: "none",
354
- ignoreRestSiblings: true,
355
- vars: "all",
356
- argsIgnorePattern: "^_"
357
- }
358
- ]
359
- }
360
- }
361
- ];
362
-
363
- const vue = (options) => {
364
- const opts = {
365
- version: 3,
366
- ts: true,
367
- ...options
368
- };
369
- const vueConfig = opts.version === 3 ? pluginVue.configs["flat/recommended"] : pluginVue.configs["flat/vue2-recommended"];
370
- const languageOptions = opts.ts ? {
371
- languageOptions: {
372
- parserOptions: {
373
- parser: neostandard.plugins["typescript-eslint"].parser
374
- }
375
- }
376
- } : {};
377
- const config = [
378
- ...vueConfig,
379
- {
380
- name: "kouts/vue",
381
- files: ["*.vue", "**/*.vue"],
382
- ...languageOptions,
383
- rules: {
384
- // Overrides for vue/(vue3-)recommended preset
385
- "vue/max-attributes-per-line": "off",
386
- "vue/singleline-html-element-content-newline": "off",
387
- // Strengthen vue/(vue3-)recommended preset for autofix
388
- // https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/configs/recommended.js
389
- "vue/attributes-order": "error",
390
- "vue/component-tags-order": "error",
391
- "vue/no-lone-template": "error",
392
- "vue/no-multiple-slot-args": "error",
393
- "vue/no-v-html": "error",
394
- "vue/order-in-components": "error",
395
- "vue/this-in-template": "error",
396
- "vue/require-prop-types": "error",
397
- // Enforce PascalCase for Vue components
398
- "vue/component-name-in-template-casing": ["error", "PascalCase", { registeredComponentsOnly: false, ignores: [] }],
399
- // Do not allow inline styles
400
- "vue/no-static-inline-styles": ["error", { allowBinding: false }],
401
- // Require explicit emits
402
- "vue/require-explicit-emits": "error",
403
- // Require component to have a name property
404
- "vue/require-name-property": "error",
405
- // Require components that don't have any content to self-close
406
- "vue/html-self-closing": [
407
- "error",
408
- {
409
- html: {
410
- void: "always",
411
- normal: "never",
412
- component: "always"
413
- },
414
- svg: "always",
415
- math: "always"
416
- }
417
- ]
418
- }
419
- }
420
- ];
421
- return config;
422
- };
423
-
424
- const config = (options) => {
425
- const opts = {
426
- ts: true,
427
- vue: true,
428
- vueVersion: 3,
429
- ...options
430
- };
431
- const linterConfig = [
432
- {
433
- name: "kouts/ignores",
434
- ignores: [
435
- "**/node_modules/**",
436
- "{tmp,temp}/**",
437
- "**/*.min.js",
438
- "vendor/**",
439
- "dist/**",
440
- "public/**",
441
- ...neostandard.resolveIgnoresFromGitignore()
442
- ]
443
- },
444
- // JavaScript
445
- {
446
- name: "kouts/javascript",
447
- ...js.configs.recommended
448
- },
449
- // TypeScript
450
- ...opts.ts ? typescript : [],
451
- // Neostandard
452
- ...neostandard({ noJsx: true, noStyle: true, semi: false, ts: opts.ts }),
453
- {
454
- name: "kouts/neostandard-overrides",
455
- rules: {
456
- // Enforce blank lines between the given 2 kinds of statements
457
- "padding-line-between-statements": [
458
- "error",
459
- { blankLine: "always", prev: "*", next: "return" },
460
- { blankLine: "always", prev: ["const", "let", "var"], next: "*" },
461
- { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"] },
462
- { blankLine: "always", prev: "directive", next: "*" },
463
- { blankLine: "any", prev: "directive", next: "directive" }
464
- ],
465
- // Console and debugger settings depending whether we're on production or not
466
- "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
467
- "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
468
- }
469
- },
470
- // Import
471
- {
472
- name: "kouts/import",
473
- plugins: {
474
- import: pluginImport
475
- },
476
- rules: {
477
- "import/export": "error",
478
- "import/first": "error",
479
- "import/no-duplicates": "error",
480
- "import/no-mutable-exports": "error",
481
- "import/no-named-default": "error",
482
- "import/no-self-import": "error",
483
- "import/no-webpack-loader-syntax": "error",
484
- "import/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }],
485
- "import/newline-after-import": ["error", { count: 1 }]
486
- }
487
- },
488
- // Sort imports
489
- {
490
- name: "kouts/sort-imports",
491
- plugins: {
492
- "simple-import-sort": pluginSimpleImportSort
493
- },
494
- rules: {
495
- "simple-import-sort/imports": [
496
- "error",
497
- // Remove all blank lines between imports
498
- {
499
- groups: [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]]
500
- }
501
- ],
502
- "simple-import-sort/exports": "error"
503
- }
504
- },
505
- // HTML
506
- {
507
- name: "kouts/html",
508
- files: ["**/*.html"],
509
- plugins: {
510
- html: pluginHtml
511
- }
512
- },
513
- // Vue
514
- ...opts.vue ? vue({ version: opts.vueVersion, ts: opts.ts }) : [],
515
- // Prettier
516
- {
517
- name: "kouts/prettier",
518
- ...pluginPrettier
519
- }
520
- ];
521
- return linterConfig;
522
- };
523
-
524
- Object.defineProperty(exports, "plugins", {
525
- enumerable: true,
526
- get: function () { return neostandard.plugins; }
527
- });
528
- exports.config = config;
package/dist/index.d.cts DELETED
@@ -1,11 +0,0 @@
1
- import { Linter } from 'eslint';
2
- export { plugins } from 'neostandard';
3
-
4
- type Options = {
5
- ts?: boolean;
6
- vue?: boolean;
7
- vueVersion?: 2 | 3;
8
- };
9
- declare const config: (options?: Options) => Linter.Config<Linter.RulesRecord>[];
10
-
11
- export { config };
package/dist/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { Linter } from 'eslint';
2
- export { plugins } from 'neostandard';
3
-
4
- type Options = {
5
- ts?: boolean;
6
- vue?: boolean;
7
- vueVersion?: 2 | 3;
8
- };
9
- declare const config: (options?: Options) => Linter.Config<Linter.RulesRecord>[];
10
-
11
- export { config };
package/dist/index.js DELETED
@@ -1,523 +0,0 @@
1
- import pluginHtml from 'eslint-plugin-html';
2
- import pluginImport from 'eslint-plugin-import-x';
3
- import pluginPrettier from 'eslint-plugin-prettier/recommended';
4
- import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
5
- import neostandard, { plugins, resolveIgnoresFromGitignore } from 'neostandard';
6
- export { plugins } from 'neostandard';
7
- import pluginVue from 'eslint-plugin-vue';
8
-
9
- function getDefaultExportFromCjs (x) {
10
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
11
- }
12
-
13
- /*
14
- * WARNING: This file is autogenerated using the tools/update-eslint-all.js
15
- * script. Do not edit manually.
16
- */
17
-
18
- /* eslint quote-props: off -- autogenerated so don't lint */
19
-
20
- /*
21
- * IMPORTANT!
22
- *
23
- * We cannot add a "name" property to this object because it's still used in eslintrc
24
- * which doesn't support the "name" property. If we add a "name" property, it will
25
- * cause an error.
26
- */
27
-
28
- var eslintAll = Object.freeze({
29
- "rules": {
30
- "accessor-pairs": "error",
31
- "array-callback-return": "error",
32
- "arrow-body-style": "error",
33
- "block-scoped-var": "error",
34
- "camelcase": "error",
35
- "capitalized-comments": "error",
36
- "class-methods-use-this": "error",
37
- "complexity": "error",
38
- "consistent-return": "error",
39
- "consistent-this": "error",
40
- "constructor-super": "error",
41
- "curly": "error",
42
- "default-case": "error",
43
- "default-case-last": "error",
44
- "default-param-last": "error",
45
- "dot-notation": "error",
46
- "eqeqeq": "error",
47
- "for-direction": "error",
48
- "func-name-matching": "error",
49
- "func-names": "error",
50
- "func-style": "error",
51
- "getter-return": "error",
52
- "grouped-accessor-pairs": "error",
53
- "guard-for-in": "error",
54
- "id-denylist": "error",
55
- "id-length": "error",
56
- "id-match": "error",
57
- "init-declarations": "error",
58
- "logical-assignment-operators": "error",
59
- "max-classes-per-file": "error",
60
- "max-depth": "error",
61
- "max-lines": "error",
62
- "max-lines-per-function": "error",
63
- "max-nested-callbacks": "error",
64
- "max-params": "error",
65
- "max-statements": "error",
66
- "new-cap": "error",
67
- "no-alert": "error",
68
- "no-array-constructor": "error",
69
- "no-async-promise-executor": "error",
70
- "no-await-in-loop": "error",
71
- "no-bitwise": "error",
72
- "no-caller": "error",
73
- "no-case-declarations": "error",
74
- "no-class-assign": "error",
75
- "no-compare-neg-zero": "error",
76
- "no-cond-assign": "error",
77
- "no-console": "error",
78
- "no-const-assign": "error",
79
- "no-constant-binary-expression": "error",
80
- "no-constant-condition": "error",
81
- "no-constructor-return": "error",
82
- "no-continue": "error",
83
- "no-control-regex": "error",
84
- "no-debugger": "error",
85
- "no-delete-var": "error",
86
- "no-div-regex": "error",
87
- "no-dupe-args": "error",
88
- "no-dupe-class-members": "error",
89
- "no-dupe-else-if": "error",
90
- "no-dupe-keys": "error",
91
- "no-duplicate-case": "error",
92
- "no-duplicate-imports": "error",
93
- "no-else-return": "error",
94
- "no-empty": "error",
95
- "no-empty-character-class": "error",
96
- "no-empty-function": "error",
97
- "no-empty-pattern": "error",
98
- "no-empty-static-block": "error",
99
- "no-eq-null": "error",
100
- "no-eval": "error",
101
- "no-ex-assign": "error",
102
- "no-extend-native": "error",
103
- "no-extra-bind": "error",
104
- "no-extra-boolean-cast": "error",
105
- "no-extra-label": "error",
106
- "no-fallthrough": "error",
107
- "no-func-assign": "error",
108
- "no-global-assign": "error",
109
- "no-implicit-coercion": "error",
110
- "no-implicit-globals": "error",
111
- "no-implied-eval": "error",
112
- "no-import-assign": "error",
113
- "no-inline-comments": "error",
114
- "no-inner-declarations": "error",
115
- "no-invalid-regexp": "error",
116
- "no-invalid-this": "error",
117
- "no-irregular-whitespace": "error",
118
- "no-iterator": "error",
119
- "no-label-var": "error",
120
- "no-labels": "error",
121
- "no-lone-blocks": "error",
122
- "no-lonely-if": "error",
123
- "no-loop-func": "error",
124
- "no-loss-of-precision": "error",
125
- "no-magic-numbers": "error",
126
- "no-misleading-character-class": "error",
127
- "no-multi-assign": "error",
128
- "no-multi-str": "error",
129
- "no-negated-condition": "error",
130
- "no-nested-ternary": "error",
131
- "no-new": "error",
132
- "no-new-func": "error",
133
- "no-new-native-nonconstructor": "error",
134
- "no-new-wrappers": "error",
135
- "no-nonoctal-decimal-escape": "error",
136
- "no-obj-calls": "error",
137
- "no-object-constructor": "error",
138
- "no-octal": "error",
139
- "no-octal-escape": "error",
140
- "no-param-reassign": "error",
141
- "no-plusplus": "error",
142
- "no-promise-executor-return": "error",
143
- "no-proto": "error",
144
- "no-prototype-builtins": "error",
145
- "no-redeclare": "error",
146
- "no-regex-spaces": "error",
147
- "no-restricted-exports": "error",
148
- "no-restricted-globals": "error",
149
- "no-restricted-imports": "error",
150
- "no-restricted-properties": "error",
151
- "no-restricted-syntax": "error",
152
- "no-return-assign": "error",
153
- "no-script-url": "error",
154
- "no-self-assign": "error",
155
- "no-self-compare": "error",
156
- "no-sequences": "error",
157
- "no-setter-return": "error",
158
- "no-shadow": "error",
159
- "no-shadow-restricted-names": "error",
160
- "no-sparse-arrays": "error",
161
- "no-template-curly-in-string": "error",
162
- "no-ternary": "error",
163
- "no-this-before-super": "error",
164
- "no-throw-literal": "error",
165
- "no-undef": "error",
166
- "no-undef-init": "error",
167
- "no-undefined": "error",
168
- "no-underscore-dangle": "error",
169
- "no-unexpected-multiline": "error",
170
- "no-unmodified-loop-condition": "error",
171
- "no-unneeded-ternary": "error",
172
- "no-unreachable": "error",
173
- "no-unreachable-loop": "error",
174
- "no-unsafe-finally": "error",
175
- "no-unsafe-negation": "error",
176
- "no-unsafe-optional-chaining": "error",
177
- "no-unused-expressions": "error",
178
- "no-unused-labels": "error",
179
- "no-unused-private-class-members": "error",
180
- "no-unused-vars": "error",
181
- "no-use-before-define": "error",
182
- "no-useless-assignment": "error",
183
- "no-useless-backreference": "error",
184
- "no-useless-call": "error",
185
- "no-useless-catch": "error",
186
- "no-useless-computed-key": "error",
187
- "no-useless-concat": "error",
188
- "no-useless-constructor": "error",
189
- "no-useless-escape": "error",
190
- "no-useless-rename": "error",
191
- "no-useless-return": "error",
192
- "no-var": "error",
193
- "no-void": "error",
194
- "no-warning-comments": "error",
195
- "no-with": "error",
196
- "object-shorthand": "error",
197
- "one-var": "error",
198
- "operator-assignment": "error",
199
- "prefer-arrow-callback": "error",
200
- "prefer-const": "error",
201
- "prefer-destructuring": "error",
202
- "prefer-exponentiation-operator": "error",
203
- "prefer-named-capture-group": "error",
204
- "prefer-numeric-literals": "error",
205
- "prefer-object-has-own": "error",
206
- "prefer-object-spread": "error",
207
- "prefer-promise-reject-errors": "error",
208
- "prefer-regex-literals": "error",
209
- "prefer-rest-params": "error",
210
- "prefer-spread": "error",
211
- "prefer-template": "error",
212
- "radix": "error",
213
- "require-atomic-updates": "error",
214
- "require-await": "error",
215
- "require-unicode-regexp": "error",
216
- "require-yield": "error",
217
- "sort-imports": "error",
218
- "sort-keys": "error",
219
- "sort-vars": "error",
220
- "strict": "error",
221
- "symbol-description": "error",
222
- "unicode-bom": "error",
223
- "use-isnan": "error",
224
- "valid-typeof": "error",
225
- "vars-on-top": "error",
226
- "yoda": "error"
227
- }
228
- });
229
-
230
- /**
231
- * @fileoverview Configuration applied when a user configuration extends from
232
- * eslint:recommended.
233
- * @author Nicholas C. Zakas
234
- */
235
-
236
- /* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
237
-
238
- /*
239
- * IMPORTANT!
240
- *
241
- * We cannot add a "name" property to this object because it's still used in eslintrc
242
- * which doesn't support the "name" property. If we add a "name" property, it will
243
- * cause an error.
244
- */
245
-
246
- var eslintRecommended = Object.freeze({
247
- rules: Object.freeze({
248
- "constructor-super": "error",
249
- "for-direction": "error",
250
- "getter-return": "error",
251
- "no-async-promise-executor": "error",
252
- "no-case-declarations": "error",
253
- "no-class-assign": "error",
254
- "no-compare-neg-zero": "error",
255
- "no-cond-assign": "error",
256
- "no-const-assign": "error",
257
- "no-constant-binary-expression": "error",
258
- "no-constant-condition": "error",
259
- "no-control-regex": "error",
260
- "no-debugger": "error",
261
- "no-delete-var": "error",
262
- "no-dupe-args": "error",
263
- "no-dupe-class-members": "error",
264
- "no-dupe-else-if": "error",
265
- "no-dupe-keys": "error",
266
- "no-duplicate-case": "error",
267
- "no-empty": "error",
268
- "no-empty-character-class": "error",
269
- "no-empty-pattern": "error",
270
- "no-empty-static-block": "error",
271
- "no-ex-assign": "error",
272
- "no-extra-boolean-cast": "error",
273
- "no-fallthrough": "error",
274
- "no-func-assign": "error",
275
- "no-global-assign": "error",
276
- "no-import-assign": "error",
277
- "no-invalid-regexp": "error",
278
- "no-irregular-whitespace": "error",
279
- "no-loss-of-precision": "error",
280
- "no-misleading-character-class": "error",
281
- "no-new-native-nonconstructor": "error",
282
- "no-nonoctal-decimal-escape": "error",
283
- "no-obj-calls": "error",
284
- "no-octal": "error",
285
- "no-prototype-builtins": "error",
286
- "no-redeclare": "error",
287
- "no-regex-spaces": "error",
288
- "no-self-assign": "error",
289
- "no-setter-return": "error",
290
- "no-shadow-restricted-names": "error",
291
- "no-sparse-arrays": "error",
292
- "no-this-before-super": "error",
293
- "no-undef": "error",
294
- "no-unexpected-multiline": "error",
295
- "no-unreachable": "error",
296
- "no-unsafe-finally": "error",
297
- "no-unsafe-negation": "error",
298
- "no-unsafe-optional-chaining": "error",
299
- "no-unused-labels": "error",
300
- "no-unused-private-class-members": "error",
301
- "no-unused-vars": "error",
302
- "no-useless-backreference": "error",
303
- "no-useless-catch": "error",
304
- "no-useless-escape": "error",
305
- "no-with": "error",
306
- "require-yield": "error",
307
- "use-isnan": "error",
308
- "valid-typeof": "error"
309
- })
310
- });
311
-
312
- /**
313
- * @fileoverview Main package entrypoint.
314
- * @author Nicholas C. Zakas
315
- */
316
-
317
- //------------------------------------------------------------------------------
318
- // Public Interface
319
- //------------------------------------------------------------------------------
320
-
321
- var src = {
322
- configs: {
323
- all: eslintAll,
324
- recommended: eslintRecommended
325
- }
326
- };
327
-
328
- var js = /*@__PURE__*/getDefaultExportFromCjs(src);
329
-
330
- const typescript = [
331
- ...plugins["typescript-eslint"].configs.recommended,
332
- {
333
- name: "kouts/typescript",
334
- rules: {
335
- // Prefer T[] instead of Array<T>
336
- "@typescript-eslint/array-type": ["error", { default: "array" }],
337
- // Prefer type over interface for objects
338
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
339
- // Fix type imports
340
- "@typescript-eslint/consistent-type-imports": [
341
- "error",
342
- {
343
- prefer: "type-imports",
344
- fixStyle: "inline-type-imports"
345
- }
346
- ],
347
- // Allow _ for unused variables
348
- "@typescript-eslint/no-unused-vars": [
349
- "error",
350
- {
351
- args: "none",
352
- caughtErrors: "none",
353
- ignoreRestSiblings: true,
354
- vars: "all",
355
- argsIgnorePattern: "^_"
356
- }
357
- ]
358
- }
359
- }
360
- ];
361
-
362
- const vue = (options) => {
363
- const opts = {
364
- version: 3,
365
- ts: true,
366
- ...options
367
- };
368
- const vueConfig = opts.version === 3 ? pluginVue.configs["flat/recommended"] : pluginVue.configs["flat/vue2-recommended"];
369
- const languageOptions = opts.ts ? {
370
- languageOptions: {
371
- parserOptions: {
372
- parser: plugins["typescript-eslint"].parser
373
- }
374
- }
375
- } : {};
376
- const config = [
377
- ...vueConfig,
378
- {
379
- name: "kouts/vue",
380
- files: ["*.vue", "**/*.vue"],
381
- ...languageOptions,
382
- rules: {
383
- // Overrides for vue/(vue3-)recommended preset
384
- "vue/max-attributes-per-line": "off",
385
- "vue/singleline-html-element-content-newline": "off",
386
- // Strengthen vue/(vue3-)recommended preset for autofix
387
- // https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/configs/recommended.js
388
- "vue/attributes-order": "error",
389
- "vue/component-tags-order": "error",
390
- "vue/no-lone-template": "error",
391
- "vue/no-multiple-slot-args": "error",
392
- "vue/no-v-html": "error",
393
- "vue/order-in-components": "error",
394
- "vue/this-in-template": "error",
395
- "vue/require-prop-types": "error",
396
- // Enforce PascalCase for Vue components
397
- "vue/component-name-in-template-casing": ["error", "PascalCase", { registeredComponentsOnly: false, ignores: [] }],
398
- // Do not allow inline styles
399
- "vue/no-static-inline-styles": ["error", { allowBinding: false }],
400
- // Require explicit emits
401
- "vue/require-explicit-emits": "error",
402
- // Require component to have a name property
403
- "vue/require-name-property": "error",
404
- // Require components that don't have any content to self-close
405
- "vue/html-self-closing": [
406
- "error",
407
- {
408
- html: {
409
- void: "always",
410
- normal: "never",
411
- component: "always"
412
- },
413
- svg: "always",
414
- math: "always"
415
- }
416
- ]
417
- }
418
- }
419
- ];
420
- return config;
421
- };
422
-
423
- const config = (options) => {
424
- const opts = {
425
- ts: true,
426
- vue: true,
427
- vueVersion: 3,
428
- ...options
429
- };
430
- const linterConfig = [
431
- {
432
- name: "kouts/ignores",
433
- ignores: [
434
- "**/node_modules/**",
435
- "{tmp,temp}/**",
436
- "**/*.min.js",
437
- "vendor/**",
438
- "dist/**",
439
- "public/**",
440
- ...resolveIgnoresFromGitignore()
441
- ]
442
- },
443
- // JavaScript
444
- {
445
- name: "kouts/javascript",
446
- ...js.configs.recommended
447
- },
448
- // TypeScript
449
- ...opts.ts ? typescript : [],
450
- // Neostandard
451
- ...neostandard({ noJsx: true, noStyle: true, semi: false, ts: opts.ts }),
452
- {
453
- name: "kouts/neostandard-overrides",
454
- rules: {
455
- // Enforce blank lines between the given 2 kinds of statements
456
- "padding-line-between-statements": [
457
- "error",
458
- { blankLine: "always", prev: "*", next: "return" },
459
- { blankLine: "always", prev: ["const", "let", "var"], next: "*" },
460
- { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"] },
461
- { blankLine: "always", prev: "directive", next: "*" },
462
- { blankLine: "any", prev: "directive", next: "directive" }
463
- ],
464
- // Console and debugger settings depending whether we're on production or not
465
- "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
466
- "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
467
- }
468
- },
469
- // Import
470
- {
471
- name: "kouts/import",
472
- plugins: {
473
- import: pluginImport
474
- },
475
- rules: {
476
- "import/export": "error",
477
- "import/first": "error",
478
- "import/no-duplicates": "error",
479
- "import/no-mutable-exports": "error",
480
- "import/no-named-default": "error",
481
- "import/no-self-import": "error",
482
- "import/no-webpack-loader-syntax": "error",
483
- "import/no-absolute-path": ["error", { esmodule: true, commonjs: true, amd: false }],
484
- "import/newline-after-import": ["error", { count: 1 }]
485
- }
486
- },
487
- // Sort imports
488
- {
489
- name: "kouts/sort-imports",
490
- plugins: {
491
- "simple-import-sort": pluginSimpleImportSort
492
- },
493
- rules: {
494
- "simple-import-sort/imports": [
495
- "error",
496
- // Remove all blank lines between imports
497
- {
498
- groups: [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]]
499
- }
500
- ],
501
- "simple-import-sort/exports": "error"
502
- }
503
- },
504
- // HTML
505
- {
506
- name: "kouts/html",
507
- files: ["**/*.html"],
508
- plugins: {
509
- html: pluginHtml
510
- }
511
- },
512
- // Vue
513
- ...opts.vue ? vue({ version: opts.vueVersion, ts: opts.ts }) : [],
514
- // Prettier
515
- {
516
- name: "kouts/prettier",
517
- ...pluginPrettier
518
- }
519
- ];
520
- return linterConfig;
521
- };
522
-
523
- export { config };
package/dist/prettier.cjs DELETED
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- const configPrettier = {
4
- trailingComma: "all",
5
- printWidth: 128,
6
- tabWidth: 2,
7
- semi: false,
8
- singleQuote: true,
9
- arrowParens: "always"
10
- };
11
-
12
- module.exports = configPrettier;
@@ -1,5 +0,0 @@
1
- import { Options } from 'prettier';
2
-
3
- declare const configPrettier: Options;
4
-
5
- export { configPrettier as default };
@@ -1,5 +0,0 @@
1
- import { Options } from 'prettier';
2
-
3
- declare const configPrettier: Options;
4
-
5
- export { configPrettier as default };
package/dist/prettier.js DELETED
@@ -1,10 +0,0 @@
1
- const configPrettier = {
2
- trailingComma: "all",
3
- printWidth: 128,
4
- tabWidth: 2,
5
- semi: false,
6
- singleQuote: true,
7
- arrowParens: "always"
8
- };
9
-
10
- export { configPrettier as default };