@ocavue/eslint-config 0.5.0-beta.3 → 1.0.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/dist/eslint.config.d.ts +3 -0
- package/dist/eslint.config.d.ts.map +1 -0
- package/dist/src/imports.d.ts.map +1 -1
- package/dist/src/shared.d.ts +1 -1
- package/dist/src/shared.d.ts.map +1 -1
- package/dist/src/typescript.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/basic.js +1 -1
- package/src/imports.js +4 -3
- package/src/shared.js +1 -0
- package/src/typescript.js +16 -2
- package/src/unicorn.js +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.js"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/imports.js"],"names":[],"mappings":"AAKO,
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/imports.js"],"names":[],"mappings":"AAKO,iFA0CN"}
|
package/dist/src/shared.d.ts
CHANGED
|
@@ -20,6 +20,6 @@ export const GLOB_ALL_SRC: readonly ["**/*.?([mt])[jt]s?(x)", "**/*.{c,le,sc}ss"
|
|
|
20
20
|
export const GLOB_NODE_MODULES: "**/node_modules";
|
|
21
21
|
export const GLOB_DIST: "**/dist";
|
|
22
22
|
export const GLOB_LOCKFILE: readonly ["**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml"];
|
|
23
|
-
export const GLOB_EXCLUDE: readonly ["**/node_modules", "**/dist", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/output", "**/coverage", "**/temp", "**/fixtures", "**/.vitepress/cache", "**/.next", "**/.nuxt", "**/.vercel", "**/.changeset", "**/.idea", "**/.output", "**/.vite-inspect", "**/dist-types", "**/CHANGELOG*.md", "**/*.min.*", "**/LICENSE*", "**/__snapshots__"];
|
|
23
|
+
export const GLOB_EXCLUDE: readonly ["**/node_modules", "**/dist", "**/package-lock.json", "**/yarn.lock", "**/pnpm-lock.yaml", "**/output", "**/coverage", "**/temp", "**/fixtures", "**/.vitepress/cache", "**/.next", "**/.nuxt", "**/.vercel", "**/.changeset", "**/.idea", "**/.output", "**/.vite-inspect", "**/.yalc", "**/dist-types", "**/CHANGELOG*.md", "**/*.min.*", "**/LICENSE*", "**/__snapshots__"];
|
|
24
24
|
export const EXTENSIONS: string[];
|
|
25
25
|
//# sourceMappingURL=shared.d.ts.map
|
package/dist/src/shared.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/shared.js"],"names":[],"mappings":"AAEA,8CAA8C;AAC9C,+CAA+C;AAE/C,uCAAuC;AACvC,yCAAyC;AAEzC,uCAAuC;AACvC,yCAAyC;AAEzC,4CAA4C;AAC5C,kCAAkC;AAClC,oCAAoC;AACpC,oCAAoC;AAEpC,oCAAoC;AACpC,sCAAsC;AACtC,sCAAsC;AAEtC,kDAAkD;AAElD,sCAAsC;AACtC,kCAAkC;AAClC,uCAAuC;AACvC,uCAAuC;AAEvC,oKASE;AAEF,kDAAyE;AACzE,kCAAyD;AACzD,mGAIE;AACF,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/shared.js"],"names":[],"mappings":"AAEA,8CAA8C;AAC9C,+CAA+C;AAE/C,uCAAuC;AACvC,yCAAyC;AAEzC,uCAAuC;AACvC,yCAAyC;AAEzC,4CAA4C;AAC5C,kCAAkC;AAClC,oCAAoC;AACpC,oCAAoC;AAEpC,oCAAoC;AACpC,sCAAsC;AACtC,sCAAsC;AAEtC,kDAAkD;AAElD,sCAAsC;AACtC,kCAAkC;AAClC,uCAAuC;AACvC,uCAAuC;AAEvC,oKASE;AAEF,kDAAyE;AACzE,kCAAyD;AACzD,mGAIE;AACF,oZAwBE;AAEF,kCAGsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.js"],"names":[],"mappings":"AAkBO,
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.js"],"names":[],"mappings":"AAkBO,2HAsEN;;;;;;;;qBArFoB,2BAA2B;qBAD3B,kCAAkC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocavue/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"description": "",
|
|
7
7
|
"author": "ocavue <ocavue@gmail.com>",
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
"src",
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"lint": "eslint .",
|
|
29
|
+
"check": "prettier --check .",
|
|
30
|
+
"fix": "eslint --fix . && prettier --write .",
|
|
31
|
+
"prepublishOnly": "nr build"
|
|
32
|
+
},
|
|
26
33
|
"dependencies": {
|
|
27
34
|
"@types/eslint": "^8.40.0",
|
|
28
35
|
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
@@ -51,11 +58,5 @@
|
|
|
51
58
|
"extends": [
|
|
52
59
|
"github>ocavue/config-renovate"
|
|
53
60
|
]
|
|
54
|
-
},
|
|
55
|
-
"scripts": {
|
|
56
|
-
"build": "tsc",
|
|
57
|
-
"lint": "eslint .",
|
|
58
|
-
"check": "prettier --check .",
|
|
59
|
-
"fix": "eslint --fix . && prettier --write ."
|
|
60
61
|
}
|
|
61
|
-
}
|
|
62
|
+
}
|
package/src/basic.js
CHANGED
|
@@ -20,7 +20,7 @@ export const basic = (options) => {
|
|
|
20
20
|
/** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
|
|
21
21
|
const config = [
|
|
22
22
|
{
|
|
23
|
-
// @ts-
|
|
23
|
+
// @ts-expect-error: 'readonly' and cannot be assigned to the mutable type 'string[]'
|
|
24
24
|
ignores: GLOB_EXCLUDE,
|
|
25
25
|
},
|
|
26
26
|
...typescript(options?.typescript),
|
package/src/imports.js
CHANGED
|
@@ -23,7 +23,8 @@ export const imports = () => {
|
|
|
23
23
|
'import/no-extraneous-dependencies': 'warn',
|
|
24
24
|
'import/first': 'warn',
|
|
25
25
|
'import/no-mutable-exports': 'warn',
|
|
26
|
-
'import/no-
|
|
26
|
+
'import/no-useless-path-segments': 'warn',
|
|
27
|
+
'import/newline-after-import': 'warn',
|
|
27
28
|
'import/order': [
|
|
28
29
|
'warn',
|
|
29
30
|
{
|
|
@@ -33,9 +34,9 @@ export const imports = () => {
|
|
|
33
34
|
'builtin',
|
|
34
35
|
'external',
|
|
35
36
|
'internal',
|
|
36
|
-
|
|
37
|
+
'parent',
|
|
38
|
+
'sibling',
|
|
37
39
|
'index',
|
|
38
|
-
'type',
|
|
39
40
|
],
|
|
40
41
|
},
|
|
41
42
|
],
|
package/src/shared.js
CHANGED
package/src/typescript.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
4
4
|
import tsParser from '@typescript-eslint/parser'
|
|
5
5
|
|
|
6
|
-
import { GLOB_TS, GLOB_TSX } from './shared.js'
|
|
6
|
+
import { GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX } from './shared.js'
|
|
7
7
|
|
|
8
8
|
export { tsParser, tsPlugin }
|
|
9
9
|
|
|
@@ -22,7 +22,7 @@ export const typescript = (options) => {
|
|
|
22
22
|
/** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
|
|
23
23
|
const config = [
|
|
24
24
|
{
|
|
25
|
-
files: [GLOB_TS, GLOB_TSX],
|
|
25
|
+
files: [GLOB_TS, GLOB_TSX, GLOB_JS, GLOB_JSX],
|
|
26
26
|
languageOptions: {
|
|
27
27
|
// @ts-expect-error: the types for `parser` seems to be wrong
|
|
28
28
|
parser: tsParser,
|
|
@@ -48,9 +48,17 @@ export const typescript = (options) => {
|
|
|
48
48
|
? tsPlugin.configs['recommended-requiring-type-checking'].rules
|
|
49
49
|
: null),
|
|
50
50
|
|
|
51
|
+
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
52
|
+
'@typescript-eslint/restrict-plus-operands': 'warn',
|
|
53
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
54
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
55
|
+
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
56
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
57
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
51
58
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
52
59
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
53
60
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
61
|
+
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
54
62
|
'@typescript-eslint/no-unused-vars': [
|
|
55
63
|
'error',
|
|
56
64
|
{
|
|
@@ -61,6 +69,12 @@ export const typescript = (options) => {
|
|
|
61
69
|
],
|
|
62
70
|
'@typescript-eslint/no-extra-semi': 'off',
|
|
63
71
|
'@typescript-eslint/prefer-function-type': 'warn',
|
|
72
|
+
|
|
73
|
+
// TODO: We should set the rules below to error in the future
|
|
74
|
+
'@typescript-eslint/no-misused-promises': 'warn',
|
|
75
|
+
'@typescript-eslint/await-thenable': 'warn',
|
|
76
|
+
'@typescript-eslint/require-await': 'warn',
|
|
77
|
+
'@typescript-eslint/unbound-method': 'warn',
|
|
64
78
|
},
|
|
65
79
|
},
|
|
66
80
|
{
|
package/src/unicorn.js
CHANGED
|
@@ -42,7 +42,7 @@ export const unicorn = () => {
|
|
|
42
42
|
// Improve regexes
|
|
43
43
|
'unicorn/better-regex': 'error',
|
|
44
44
|
// Enforce combining multiple `Array#push()` into one call.
|
|
45
|
-
'unicorn/no-array-push-push': '
|
|
45
|
+
'unicorn/no-array-push-push': 'warn',
|
|
46
46
|
// Do not use a `for` loop that can be replaced with a `for-of` loop.
|
|
47
47
|
'unicorn/no-for-loop': 'error',
|
|
48
48
|
// Prefer `.addEventListener()` and `.removeEventListener()` over `on`-functions.
|
|
@@ -60,7 +60,7 @@ export const unicorn = () => {
|
|
|
60
60
|
// Prefer negative index over `.length - index` when possible
|
|
61
61
|
'unicorn/prefer-negative-index': 'error',
|
|
62
62
|
// Prefer `Number` static properties over global ones.
|
|
63
|
-
'unicorn/prefer-number-properties': '
|
|
63
|
+
'unicorn/prefer-number-properties': 'warn',
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
]
|