@truenine/eslint9-config 1.0.14 → 1.0.17
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 +189 -92
- package/dist/defaults/index.d.ts +38 -33
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/index.js +181 -190
- package/dist/defaults/index.js.map +1 -0
- package/dist/index.d.ts +20 -15
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -49
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +45 -39
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +0 -0
- package/package.json +22 -32
- package/dist/defaults/index.cjs +0 -200
- package/dist/index.cjs +0 -51
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truenine/eslint9-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.17",
|
|
5
5
|
"description": "ESLint 9 configuration package for Compose Client projects with TypeScript, Vue, and modern JavaScript support",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "TrueNine",
|
|
@@ -35,23 +35,14 @@
|
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"exports": {
|
|
37
37
|
".": {
|
|
38
|
-
"types": "./dist/index.d.ts",
|
|
39
38
|
"import": "./dist/index.js",
|
|
40
39
|
"require": "./dist/index.cjs"
|
|
41
40
|
},
|
|
42
|
-
"./types": {
|
|
43
|
-
"types": "./dist/types/index.d.ts"
|
|
44
|
-
},
|
|
45
|
-
"./defaults": {
|
|
46
|
-
"types": "./dist/defaults/index.d.ts",
|
|
47
|
-
"import": "./dist/defaults/index.js",
|
|
48
|
-
"require": "./dist/defaults/index.cjs"
|
|
49
|
-
},
|
|
50
41
|
"./*": "./*"
|
|
51
42
|
},
|
|
52
|
-
"main": "dist/index.cjs",
|
|
53
|
-
"module": "dist/index.js",
|
|
54
|
-
"types": "dist/index.d.
|
|
43
|
+
"main": "./dist/index.cjs",
|
|
44
|
+
"module": "./dist/index.js",
|
|
45
|
+
"types": "./dist/index.d.cts",
|
|
55
46
|
"files": [
|
|
56
47
|
"LICENSE",
|
|
57
48
|
"README.md",
|
|
@@ -65,36 +56,35 @@
|
|
|
65
56
|
"registry": "https://registry.npmjs.org/"
|
|
66
57
|
},
|
|
67
58
|
"peerDependencies": {
|
|
68
|
-
"@antfu/eslint-config": "^5.
|
|
69
|
-
"@eslint/js": "^9.
|
|
70
|
-
"@unocss/eslint-config": "^66.
|
|
59
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
60
|
+
"@eslint/js": "^9.36.0",
|
|
61
|
+
"@unocss/eslint-config": "^66.5.2",
|
|
71
62
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
72
63
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
73
|
-
"eslint": "^9.
|
|
74
|
-
"eslint-plugin-format": "^1.0.
|
|
75
|
-
"eslint-plugin-prettier": "^5.5.
|
|
76
|
-
"eslint-plugin-vue": "^10.
|
|
64
|
+
"eslint": "^9.37.0",
|
|
65
|
+
"eslint-plugin-format": "^1.0.2",
|
|
66
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
67
|
+
"eslint-plugin-vue": "^10.5.0",
|
|
77
68
|
"prettier": "^3.6.2",
|
|
78
|
-
"typescript-eslint": "^8.
|
|
69
|
+
"typescript-eslint": "^8.45.0"
|
|
79
70
|
},
|
|
80
71
|
"dependencies": {
|
|
81
|
-
"@antfu/eslint-config": "^5.
|
|
82
|
-
"@eslint/js": "^9.
|
|
83
|
-
"@unocss/eslint-config": "^66.
|
|
72
|
+
"@antfu/eslint-config": "^5.4.1",
|
|
73
|
+
"@eslint/js": "^9.36.0",
|
|
74
|
+
"@unocss/eslint-config": "^66.5.2",
|
|
84
75
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
85
76
|
"@vue/eslint-config-typescript": "^14.6.0",
|
|
86
|
-
"eslint": "^9.
|
|
87
|
-
"eslint-plugin-format": "^1.0.
|
|
88
|
-
"eslint-plugin-prettier": "^5.5.
|
|
89
|
-
"eslint-plugin-vue": "^10.
|
|
77
|
+
"eslint": "^9.37.0",
|
|
78
|
+
"eslint-plugin-format": "^1.0.2",
|
|
79
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
80
|
+
"eslint-plugin-vue": "^10.5.0",
|
|
90
81
|
"prettier": "^3.6.2",
|
|
91
|
-
"typescript-eslint": "^8.
|
|
82
|
+
"typescript-eslint": "^8.45.0"
|
|
92
83
|
},
|
|
93
84
|
"scripts": {
|
|
94
|
-
"build": "
|
|
95
|
-
"build-c": "vite build",
|
|
85
|
+
"build": "tsdown",
|
|
96
86
|
"lint": "eslint --fix",
|
|
97
|
-
"type-check": "
|
|
87
|
+
"type-check": "tsc --noEmit -p tsconfig.lib.json",
|
|
98
88
|
"test": "vitest run",
|
|
99
89
|
"copy-license": "node -e \"require('fs').copyFileSync('../../LICENSE', './LICENSE')\""
|
|
100
90
|
}
|
package/dist/defaults/index.cjs
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const defaultUnocssConfig = {
|
|
4
|
-
attributify: true,
|
|
5
|
-
strict: true
|
|
6
|
-
};
|
|
7
|
-
const defaultVueConfig = {
|
|
8
|
-
vueVersion: 3,
|
|
9
|
-
overrides: {
|
|
10
|
-
"vue/html-self-closing": ["error", {
|
|
11
|
-
html: {
|
|
12
|
-
void: "always",
|
|
13
|
-
normal: "always",
|
|
14
|
-
component: "always"
|
|
15
|
-
}
|
|
16
|
-
}],
|
|
17
|
-
"vue/html-comment-content-spacing": ["error", "always", { exceptions: [] }],
|
|
18
|
-
"vue/html-comment-indent": ["error", 2],
|
|
19
|
-
"vue/html-indent": ["error", 2, {
|
|
20
|
-
baseIndent: 0,
|
|
21
|
-
alignAttributesVertically: true
|
|
22
|
-
}],
|
|
23
|
-
"vue/define-emits-declaration": ["error", "type-literal"],
|
|
24
|
-
"vue/define-props-declaration": ["error", "type-based"],
|
|
25
|
-
"vue/define-macros-order": [
|
|
26
|
-
"error",
|
|
27
|
-
{
|
|
28
|
-
order: [
|
|
29
|
-
"defineProps",
|
|
30
|
-
"defineEmits",
|
|
31
|
-
"defineModel",
|
|
32
|
-
"defineSlots"
|
|
33
|
-
],
|
|
34
|
-
defineExposeLast: true
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"vue/block-order": [
|
|
38
|
-
"error",
|
|
39
|
-
{
|
|
40
|
-
order: ["script", "template", "style"]
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
"vue/attributes-order": [
|
|
44
|
-
"error",
|
|
45
|
-
{
|
|
46
|
-
order: ["DEFINITION", "LIST_RENDERING", "CONDITIONALS", "RENDER_MODIFIERS", "GLOBAL", "UNIQUE", "TWO_WAY_BINDING", "OTHER_DIRECTIVES", "OTHER_ATTR", "EVENTS", "CONTENT"]
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"vue/v-on-event-hyphenation": [
|
|
50
|
-
"error",
|
|
51
|
-
"never",
|
|
52
|
-
{
|
|
53
|
-
autofix: true
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
"vue/attribute-hyphenation": [
|
|
57
|
-
"error",
|
|
58
|
-
"never",
|
|
59
|
-
{
|
|
60
|
-
ignoreTags: ["i-", "v-", "v-bind"]
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"vue/prop-name-casing": ["error", "camelCase"],
|
|
64
|
-
"vue/component-name-in-template-casing": [
|
|
65
|
-
"error",
|
|
66
|
-
"PascalCase",
|
|
67
|
-
{
|
|
68
|
-
ignores: ["router-view", "router-link", "scroll-view"],
|
|
69
|
-
registeredComponentsOnly: false
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
const defaultJsConfig = {
|
|
75
|
-
overrides: {
|
|
76
|
-
"no-inline-comments": "error",
|
|
77
|
-
"unicorn/no-useless-spread": "error",
|
|
78
|
-
"curly": ["error", "all"],
|
|
79
|
-
"no-undefined": "error",
|
|
80
|
-
"no-cond-assign": ["error", "always"],
|
|
81
|
-
"no-constant-condition": "error",
|
|
82
|
-
"no-restricted-syntax": "error",
|
|
83
|
-
"no-global-assign": "error",
|
|
84
|
-
"no-unused-vars": "error",
|
|
85
|
-
"no-var": "error",
|
|
86
|
-
"prefer-const": [
|
|
87
|
-
"error",
|
|
88
|
-
{
|
|
89
|
-
destructuring: "any",
|
|
90
|
-
ignoreReadBeforeAssign: false
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const defaultTsConfig = {
|
|
96
|
-
overrides: {
|
|
97
|
-
"ts/no-unsafe-assignment": "off",
|
|
98
|
-
"ts/no-unsafe-call": "off",
|
|
99
|
-
"ts/no-unsafe-argument": "off",
|
|
100
|
-
"ts/no-unsafe-return": "off",
|
|
101
|
-
"ts/member-ordering": ["error"],
|
|
102
|
-
"ts/no-extra-non-null-assertion": "error",
|
|
103
|
-
"ts/no-non-null-assertion": "error",
|
|
104
|
-
"ts/no-explicit-any": ["error", {
|
|
105
|
-
fixToUnknown: true,
|
|
106
|
-
ignoreRestArgs: true
|
|
107
|
-
}],
|
|
108
|
-
"ts/no-namespace": "error",
|
|
109
|
-
"ts/no-unused-vars": [
|
|
110
|
-
"error",
|
|
111
|
-
{
|
|
112
|
-
vars: "all",
|
|
113
|
-
args: "after-used",
|
|
114
|
-
ignoreRestSiblings: false
|
|
115
|
-
}
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const defaultFormatterConfig = {
|
|
120
|
-
css: "prettier",
|
|
121
|
-
html: "prettier",
|
|
122
|
-
prettierOptions: {
|
|
123
|
-
printWidth: 160,
|
|
124
|
-
tabWidth: 2,
|
|
125
|
-
arrowParens: "always",
|
|
126
|
-
vueIndentScriptAndStyle: true,
|
|
127
|
-
useTabs: false,
|
|
128
|
-
singleQuote: true,
|
|
129
|
-
jsxSingleQuote: true,
|
|
130
|
-
trailingComma: "all",
|
|
131
|
-
bracketSpacing: true
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
const defaultStrictTsConfig = {
|
|
135
|
-
overrides: {
|
|
136
|
-
"ts/no-unsafe-assignment": "off",
|
|
137
|
-
"ts/no-unsafe-call": "off",
|
|
138
|
-
"ts/no-unsafe-argument": "off",
|
|
139
|
-
"ts/no-unsafe-return": "off",
|
|
140
|
-
"ts/no-floating-promises": "error"
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
const defaultStylisticConfig = {
|
|
144
|
-
jsx: true,
|
|
145
|
-
indent: 2,
|
|
146
|
-
quotes: "single",
|
|
147
|
-
semi: false,
|
|
148
|
-
overrides: {
|
|
149
|
-
"style/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
150
|
-
"style/brace-style": ["error", "1tbs"],
|
|
151
|
-
"style/arrow-parens": ["error", "always"]
|
|
152
|
-
}
|
|
153
|
-
};
|
|
154
|
-
const defaultTestConfig = {
|
|
155
|
-
overrides: {
|
|
156
|
-
"no-console": "off",
|
|
157
|
-
"ts/unbound-method": "off",
|
|
158
|
-
"ts/no-unsafe-argument": "off",
|
|
159
|
-
"ts/no-unsafe-assignment": "off",
|
|
160
|
-
"ts/no-unsafe-member-access": "off",
|
|
161
|
-
"ts/no-unsafe-call": "off",
|
|
162
|
-
"ts/no-unsafe-return": "off"
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
function mergeWithDefaults(value, defaults) {
|
|
166
|
-
if (defaults === false || defaults === null || defaults === void 0) {
|
|
167
|
-
if (value === true) {
|
|
168
|
-
return true;
|
|
169
|
-
}
|
|
170
|
-
if (value === false || value === null) {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
return value;
|
|
174
|
-
}
|
|
175
|
-
if (value === void 0) {
|
|
176
|
-
return defaults;
|
|
177
|
-
}
|
|
178
|
-
if (value === false || value === null) {
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
if (value === true) {
|
|
182
|
-
return defaults;
|
|
183
|
-
}
|
|
184
|
-
if (typeof value === "object" && typeof defaults === "object") {
|
|
185
|
-
return {
|
|
186
|
-
...defaults,
|
|
187
|
-
...value
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
return value;
|
|
191
|
-
}
|
|
192
|
-
exports.defaultFormatterConfig = defaultFormatterConfig;
|
|
193
|
-
exports.defaultJsConfig = defaultJsConfig;
|
|
194
|
-
exports.defaultStrictTsConfig = defaultStrictTsConfig;
|
|
195
|
-
exports.defaultStylisticConfig = defaultStylisticConfig;
|
|
196
|
-
exports.defaultTestConfig = defaultTestConfig;
|
|
197
|
-
exports.defaultTsConfig = defaultTsConfig;
|
|
198
|
-
exports.defaultUnocssConfig = defaultUnocssConfig;
|
|
199
|
-
exports.defaultVueConfig = defaultVueConfig;
|
|
200
|
-
exports.mergeWithDefaults = mergeWithDefaults;
|
package/dist/index.cjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const eslintConfig = require("@antfu/eslint-config");
|
|
3
|
-
const index = require("./defaults/index.cjs");
|
|
4
|
-
async function eslint9(options = {}) {
|
|
5
|
-
const {
|
|
6
|
-
type = "lib",
|
|
7
|
-
ignores = [],
|
|
8
|
-
test = true,
|
|
9
|
-
unocss = false,
|
|
10
|
-
vue = false,
|
|
11
|
-
jsx = false,
|
|
12
|
-
pnpm = false,
|
|
13
|
-
stylistic = true,
|
|
14
|
-
javascript = index.defaultJsConfig,
|
|
15
|
-
typescript = index.defaultTsConfig,
|
|
16
|
-
formatters = false
|
|
17
|
-
} = options;
|
|
18
|
-
const _test = index.mergeWithDefaults(test, index.defaultTestConfig);
|
|
19
|
-
const _unocss = index.mergeWithDefaults(unocss, index.defaultUnocssConfig);
|
|
20
|
-
const _vue = index.mergeWithDefaults(vue, index.defaultVueConfig);
|
|
21
|
-
const _javascript = index.mergeWithDefaults(javascript, index.defaultJsConfig);
|
|
22
|
-
const _stylistic = index.mergeWithDefaults(stylistic, index.defaultStylisticConfig);
|
|
23
|
-
const _formatters = index.mergeWithDefaults(formatters, index.defaultFormatterConfig);
|
|
24
|
-
let _typescript = typescript;
|
|
25
|
-
let _pnpm = pnpm;
|
|
26
|
-
if (type === "app") {
|
|
27
|
-
_pnpm = false;
|
|
28
|
-
}
|
|
29
|
-
if (_typescript !== null && typeof _typescript === "object" && "strictTypescriptEslint" in _typescript && _typescript.strictTypescriptEslint === true) {
|
|
30
|
-
_typescript = index.mergeWithDefaults(typescript, index.defaultStrictTsConfig);
|
|
31
|
-
if (typeof _typescript === "object" && "tsconfigPath" in _typescript) {
|
|
32
|
-
_typescript.parserOptions = {
|
|
33
|
-
projectService: true
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return eslintConfig.antfu({
|
|
38
|
-
type,
|
|
39
|
-
ignores,
|
|
40
|
-
pnpm: _pnpm,
|
|
41
|
-
test: _test,
|
|
42
|
-
unocss: _unocss,
|
|
43
|
-
vue: _vue,
|
|
44
|
-
jsx,
|
|
45
|
-
typescript: _typescript,
|
|
46
|
-
javascript: _javascript,
|
|
47
|
-
stylistic: _stylistic,
|
|
48
|
-
formatters: _formatters
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
module.exports = eslint9;
|