@icebreakers/eslint-config 0.7.0 → 0.7.1
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/index.cjs +61 -47
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +61 -47
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -8941,56 +8941,70 @@ var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
|
8941
8941
|
|
|
8942
8942
|
// src/defaults.ts
|
|
8943
8943
|
init_cjs_shims();
|
|
8944
|
-
function getDefaultVueOptions() {
|
|
8944
|
+
function getDefaultVueOptions(opts) {
|
|
8945
|
+
const overrides2 = {
|
|
8946
|
+
"vue/attribute-hyphenation": "off",
|
|
8947
|
+
"vue/v-on-event-hyphenation": "off",
|
|
8948
|
+
"vue/custom-event-name-casing": "off",
|
|
8949
|
+
"vue/no-mutating-props": "warn",
|
|
8950
|
+
// https://eslint.vuejs.org/rules/no-useless-v-bind.html
|
|
8951
|
+
"vue/no-useless-v-bind": [
|
|
8952
|
+
"error",
|
|
8953
|
+
{
|
|
8954
|
+
// 不允许注释
|
|
8955
|
+
ignoreIncludesComment: false,
|
|
8956
|
+
// 允许在里面使用转义
|
|
8957
|
+
// 比如 v-bind:foo="'bar\nbaz'"
|
|
8958
|
+
ignoreStringEscape: true
|
|
8959
|
+
}
|
|
8960
|
+
],
|
|
8961
|
+
// https://eslint.vuejs.org/rules/no-unused-refs.html
|
|
8962
|
+
"vue/no-unused-refs": "warn"
|
|
8963
|
+
};
|
|
8964
|
+
if (opts?.ionic) {
|
|
8965
|
+
overrides2["vue/no-deprecated-slot-attribute"] = "off";
|
|
8966
|
+
}
|
|
8945
8967
|
const vueOptions = {
|
|
8946
|
-
overrides:
|
|
8947
|
-
"vue/attribute-hyphenation": "off",
|
|
8948
|
-
"vue/v-on-event-hyphenation": "off",
|
|
8949
|
-
"vue/custom-event-name-casing": "off",
|
|
8950
|
-
"vue/no-mutating-props": "warn",
|
|
8951
|
-
// https://eslint.vuejs.org/rules/no-useless-v-bind.html
|
|
8952
|
-
"vue/no-useless-v-bind": [
|
|
8953
|
-
"error",
|
|
8954
|
-
{
|
|
8955
|
-
// 不允许注释
|
|
8956
|
-
ignoreIncludesComment: false,
|
|
8957
|
-
// 允许在里面使用转义
|
|
8958
|
-
// 比如 v-bind:foo="'bar\nbaz'"
|
|
8959
|
-
ignoreStringEscape: true
|
|
8960
|
-
}
|
|
8961
|
-
],
|
|
8962
|
-
// https://eslint.vuejs.org/rules/no-unused-refs.html
|
|
8963
|
-
"vue/no-unused-refs": "warn"
|
|
8964
|
-
}
|
|
8968
|
+
overrides: overrides2
|
|
8965
8969
|
};
|
|
8966
8970
|
return vueOptions;
|
|
8967
8971
|
}
|
|
8968
|
-
function getDefaultTypescriptOptions() {
|
|
8972
|
+
function getDefaultTypescriptOptions(opts) {
|
|
8973
|
+
const overrides2 = {
|
|
8974
|
+
"ts/no-unused-vars": [
|
|
8975
|
+
"error",
|
|
8976
|
+
{
|
|
8977
|
+
args: "all",
|
|
8978
|
+
argsIgnorePattern: "^_",
|
|
8979
|
+
caughtErrors: "all",
|
|
8980
|
+
caughtErrorsIgnorePattern: "^_",
|
|
8981
|
+
destructuredArrayIgnorePattern: "^_",
|
|
8982
|
+
varsIgnorePattern: "^_",
|
|
8983
|
+
ignoreRestSiblings: true
|
|
8984
|
+
}
|
|
8985
|
+
],
|
|
8986
|
+
"ts/prefer-ts-expect-error": "off",
|
|
8987
|
+
"ts/ban-ts-comment": "off",
|
|
8988
|
+
"ts/no-use-before-define": "warn",
|
|
8989
|
+
"ts/no-unused-expressions": [
|
|
8990
|
+
"error",
|
|
8991
|
+
{
|
|
8992
|
+
allowShortCircuit: true,
|
|
8993
|
+
allowTernary: true
|
|
8994
|
+
}
|
|
8995
|
+
]
|
|
8996
|
+
};
|
|
8997
|
+
if (opts?.nest) {
|
|
8998
|
+
Object.assign(overrides2, {
|
|
8999
|
+
"ts/interface-name-prefix": "off",
|
|
9000
|
+
"ts/explicit-function-return-type": "off",
|
|
9001
|
+
"ts/explicit-module-boundary-types": "off",
|
|
9002
|
+
"ts/no-explicit-any": "off",
|
|
9003
|
+
"ts/consistent-type-imports": "off"
|
|
9004
|
+
});
|
|
9005
|
+
}
|
|
8969
9006
|
const typescriptOptions = {
|
|
8970
|
-
overrides:
|
|
8971
|
-
"ts/no-unused-vars": [
|
|
8972
|
-
"error",
|
|
8973
|
-
{
|
|
8974
|
-
args: "all",
|
|
8975
|
-
argsIgnorePattern: "^_",
|
|
8976
|
-
caughtErrors: "all",
|
|
8977
|
-
caughtErrorsIgnorePattern: "^_",
|
|
8978
|
-
destructuredArrayIgnorePattern: "^_",
|
|
8979
|
-
varsIgnorePattern: "^_",
|
|
8980
|
-
ignoreRestSiblings: true
|
|
8981
|
-
}
|
|
8982
|
-
],
|
|
8983
|
-
"ts/prefer-ts-expect-error": "off",
|
|
8984
|
-
"ts/ban-ts-comment": "off",
|
|
8985
|
-
"ts/no-use-before-define": "warn",
|
|
8986
|
-
"ts/no-unused-expressions": [
|
|
8987
|
-
"error",
|
|
8988
|
-
{
|
|
8989
|
-
allowShortCircuit: true,
|
|
8990
|
-
allowTernary: true
|
|
8991
|
-
}
|
|
8992
|
-
]
|
|
8993
|
-
}
|
|
9007
|
+
overrides: overrides2
|
|
8994
9008
|
};
|
|
8995
9009
|
return typescriptOptions;
|
|
8996
9010
|
}
|
|
@@ -9016,13 +9030,13 @@ function getPresets(options, mode) {
|
|
|
9016
9030
|
}
|
|
9017
9031
|
}
|
|
9018
9032
|
});
|
|
9019
|
-
const vueOptions = getDefaultVueOptions();
|
|
9033
|
+
const vueOptions = getDefaultVueOptions(options);
|
|
9020
9034
|
if (opts.vue === true) {
|
|
9021
9035
|
opts.vue = vueOptions;
|
|
9022
9036
|
} else if (isObject(opts.vue)) {
|
|
9023
9037
|
opts.vue = defu(opts.vue, vueOptions);
|
|
9024
9038
|
}
|
|
9025
|
-
const typescriptOptions = getDefaultTypescriptOptions();
|
|
9039
|
+
const typescriptOptions = getDefaultTypescriptOptions(options);
|
|
9026
9040
|
if (opts.typescript === void 0 || opts.typescript === true) {
|
|
9027
9041
|
opts.typescript = typescriptOptions;
|
|
9028
9042
|
} else if (isObject(opts.typescript)) {
|
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,8 @@ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
|
6
6
|
tailwindcss?: boolean;
|
|
7
7
|
mdx?: boolean;
|
|
8
8
|
a11y?: boolean;
|
|
9
|
+
nest?: boolean;
|
|
10
|
+
ionic?: boolean;
|
|
9
11
|
};
|
|
10
12
|
type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>;
|
|
11
13
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ type UserDefinedOptions = OptionsConfig & TypedFlatConfigItem & {
|
|
|
6
6
|
tailwindcss?: boolean;
|
|
7
7
|
mdx?: boolean;
|
|
8
8
|
a11y?: boolean;
|
|
9
|
+
nest?: boolean;
|
|
10
|
+
ionic?: boolean;
|
|
9
11
|
};
|
|
10
12
|
type UserConfigItem = Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | FlatConfigComposer<any, any> | Linter.Config[]>;
|
|
11
13
|
|
package/dist/index.js
CHANGED
|
@@ -89,56 +89,70 @@ var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
|
89
89
|
|
|
90
90
|
// src/defaults.ts
|
|
91
91
|
init_esm_shims();
|
|
92
|
-
function getDefaultVueOptions() {
|
|
92
|
+
function getDefaultVueOptions(opts) {
|
|
93
|
+
const overrides = {
|
|
94
|
+
"vue/attribute-hyphenation": "off",
|
|
95
|
+
"vue/v-on-event-hyphenation": "off",
|
|
96
|
+
"vue/custom-event-name-casing": "off",
|
|
97
|
+
"vue/no-mutating-props": "warn",
|
|
98
|
+
// https://eslint.vuejs.org/rules/no-useless-v-bind.html
|
|
99
|
+
"vue/no-useless-v-bind": [
|
|
100
|
+
"error",
|
|
101
|
+
{
|
|
102
|
+
// 不允许注释
|
|
103
|
+
ignoreIncludesComment: false,
|
|
104
|
+
// 允许在里面使用转义
|
|
105
|
+
// 比如 v-bind:foo="'bar\nbaz'"
|
|
106
|
+
ignoreStringEscape: true
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
// https://eslint.vuejs.org/rules/no-unused-refs.html
|
|
110
|
+
"vue/no-unused-refs": "warn"
|
|
111
|
+
};
|
|
112
|
+
if (opts?.ionic) {
|
|
113
|
+
overrides["vue/no-deprecated-slot-attribute"] = "off";
|
|
114
|
+
}
|
|
93
115
|
const vueOptions = {
|
|
94
|
-
overrides
|
|
95
|
-
"vue/attribute-hyphenation": "off",
|
|
96
|
-
"vue/v-on-event-hyphenation": "off",
|
|
97
|
-
"vue/custom-event-name-casing": "off",
|
|
98
|
-
"vue/no-mutating-props": "warn",
|
|
99
|
-
// https://eslint.vuejs.org/rules/no-useless-v-bind.html
|
|
100
|
-
"vue/no-useless-v-bind": [
|
|
101
|
-
"error",
|
|
102
|
-
{
|
|
103
|
-
// 不允许注释
|
|
104
|
-
ignoreIncludesComment: false,
|
|
105
|
-
// 允许在里面使用转义
|
|
106
|
-
// 比如 v-bind:foo="'bar\nbaz'"
|
|
107
|
-
ignoreStringEscape: true
|
|
108
|
-
}
|
|
109
|
-
],
|
|
110
|
-
// https://eslint.vuejs.org/rules/no-unused-refs.html
|
|
111
|
-
"vue/no-unused-refs": "warn"
|
|
112
|
-
}
|
|
116
|
+
overrides
|
|
113
117
|
};
|
|
114
118
|
return vueOptions;
|
|
115
119
|
}
|
|
116
|
-
function getDefaultTypescriptOptions() {
|
|
120
|
+
function getDefaultTypescriptOptions(opts) {
|
|
121
|
+
const overrides = {
|
|
122
|
+
"ts/no-unused-vars": [
|
|
123
|
+
"error",
|
|
124
|
+
{
|
|
125
|
+
args: "all",
|
|
126
|
+
argsIgnorePattern: "^_",
|
|
127
|
+
caughtErrors: "all",
|
|
128
|
+
caughtErrorsIgnorePattern: "^_",
|
|
129
|
+
destructuredArrayIgnorePattern: "^_",
|
|
130
|
+
varsIgnorePattern: "^_",
|
|
131
|
+
ignoreRestSiblings: true
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"ts/prefer-ts-expect-error": "off",
|
|
135
|
+
"ts/ban-ts-comment": "off",
|
|
136
|
+
"ts/no-use-before-define": "warn",
|
|
137
|
+
"ts/no-unused-expressions": [
|
|
138
|
+
"error",
|
|
139
|
+
{
|
|
140
|
+
allowShortCircuit: true,
|
|
141
|
+
allowTernary: true
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
};
|
|
145
|
+
if (opts?.nest) {
|
|
146
|
+
Object.assign(overrides, {
|
|
147
|
+
"ts/interface-name-prefix": "off",
|
|
148
|
+
"ts/explicit-function-return-type": "off",
|
|
149
|
+
"ts/explicit-module-boundary-types": "off",
|
|
150
|
+
"ts/no-explicit-any": "off",
|
|
151
|
+
"ts/consistent-type-imports": "off"
|
|
152
|
+
});
|
|
153
|
+
}
|
|
117
154
|
const typescriptOptions = {
|
|
118
|
-
overrides
|
|
119
|
-
"ts/no-unused-vars": [
|
|
120
|
-
"error",
|
|
121
|
-
{
|
|
122
|
-
args: "all",
|
|
123
|
-
argsIgnorePattern: "^_",
|
|
124
|
-
caughtErrors: "all",
|
|
125
|
-
caughtErrorsIgnorePattern: "^_",
|
|
126
|
-
destructuredArrayIgnorePattern: "^_",
|
|
127
|
-
varsIgnorePattern: "^_",
|
|
128
|
-
ignoreRestSiblings: true
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
|
-
"ts/prefer-ts-expect-error": "off",
|
|
132
|
-
"ts/ban-ts-comment": "off",
|
|
133
|
-
"ts/no-use-before-define": "warn",
|
|
134
|
-
"ts/no-unused-expressions": [
|
|
135
|
-
"error",
|
|
136
|
-
{
|
|
137
|
-
allowShortCircuit: true,
|
|
138
|
-
allowTernary: true
|
|
139
|
-
}
|
|
140
|
-
]
|
|
141
|
-
}
|
|
155
|
+
overrides
|
|
142
156
|
};
|
|
143
157
|
return typescriptOptions;
|
|
144
158
|
}
|
|
@@ -164,13 +178,13 @@ function getPresets(options, mode) {
|
|
|
164
178
|
}
|
|
165
179
|
}
|
|
166
180
|
});
|
|
167
|
-
const vueOptions = getDefaultVueOptions();
|
|
181
|
+
const vueOptions = getDefaultVueOptions(options);
|
|
168
182
|
if (opts.vue === true) {
|
|
169
183
|
opts.vue = vueOptions;
|
|
170
184
|
} else if (isObject(opts.vue)) {
|
|
171
185
|
opts.vue = defu(opts.vue, vueOptions);
|
|
172
186
|
}
|
|
173
|
-
const typescriptOptions = getDefaultTypescriptOptions();
|
|
187
|
+
const typescriptOptions = getDefaultTypescriptOptions(options);
|
|
174
188
|
if (opts.typescript === void 0 || opts.typescript === true) {
|
|
175
189
|
opts.typescript = typescriptOptions;
|
|
176
190
|
} else if (isObject(opts.typescript)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.1",
|
|
5
5
|
"description": "icebreakers's eslint config",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@antfu/eslint-config": "3.8.0",
|
|
44
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
44
|
+
"@eslint-react/eslint-plugin": "^1.16.1",
|
|
45
45
|
"eslint-plugin-format": "0.1.2",
|
|
46
46
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
47
47
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"eslint-plugin-vuejs-accessibility": "^2.4.1"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"@unocss/eslint-plugin": "^0.
|
|
53
|
+
"@unocss/eslint-plugin": "^0.64.0",
|
|
54
54
|
"eslint-plugin-mdx": "3.1.5"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|