@so1ve/eslint-config 1.2.0 → 1.4.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/index.cjs +23 -22
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +20 -16
- package/package.json +6 -5
package/dist/index.cjs
CHANGED
|
@@ -7,8 +7,7 @@ var pluginHtml = require('@html-eslint/eslint-plugin');
|
|
|
7
7
|
var parserHtml = require('@html-eslint/parser');
|
|
8
8
|
var pluginSo1ve = require('@so1ve/eslint-plugin');
|
|
9
9
|
var pluginSortImports = require('@so1ve/eslint-plugin-sort-imports');
|
|
10
|
-
var
|
|
11
|
-
var parserTs = require('@typescript-eslint/parser');
|
|
10
|
+
var pluginStylistic = require('@stylistic/eslint-plugin');
|
|
12
11
|
var eslintMdx = require('eslint-mdx');
|
|
13
12
|
var pluginArrayFunc = require('eslint-plugin-array-func');
|
|
14
13
|
var pluginEtc = require('eslint-plugin-etc');
|
|
@@ -36,6 +35,7 @@ var parserToml = require('toml-eslint-parser');
|
|
|
36
35
|
var parserVue = require('vue-eslint-parser');
|
|
37
36
|
var parserYaml = require('yaml-eslint-parser');
|
|
38
37
|
var globals = require('globals');
|
|
38
|
+
var tseslint = require('typescript-eslint');
|
|
39
39
|
var fs = require('node:fs');
|
|
40
40
|
var gitignore = require('eslint-config-flat-gitignore');
|
|
41
41
|
var localPkg = require('local-pkg');
|
|
@@ -65,8 +65,7 @@ var pluginHtml__default = /*#__PURE__*/_interopDefaultLegacy(pluginHtml);
|
|
|
65
65
|
var parserHtml__default = /*#__PURE__*/_interopDefaultLegacy(parserHtml);
|
|
66
66
|
var pluginSo1ve__default = /*#__PURE__*/_interopDefaultLegacy(pluginSo1ve);
|
|
67
67
|
var pluginSortImports__default = /*#__PURE__*/_interopDefaultLegacy(pluginSortImports);
|
|
68
|
-
var
|
|
69
|
-
var parserTs__default = /*#__PURE__*/_interopDefaultLegacy(parserTs);
|
|
68
|
+
var pluginStylistic__default = /*#__PURE__*/_interopDefaultLegacy(pluginStylistic);
|
|
70
69
|
var eslintMdx__default = /*#__PURE__*/_interopDefaultLegacy(eslintMdx);
|
|
71
70
|
var pluginArrayFunc__default = /*#__PURE__*/_interopDefaultLegacy(pluginArrayFunc);
|
|
72
71
|
var pluginEtc__default = /*#__PURE__*/_interopDefaultLegacy(pluginEtc);
|
|
@@ -94,6 +93,7 @@ var parserToml__default = /*#__PURE__*/_interopDefaultLegacy(parserToml);
|
|
|
94
93
|
var parserVue__default = /*#__PURE__*/_interopDefaultLegacy(parserVue);
|
|
95
94
|
var parserYaml__default = /*#__PURE__*/_interopDefaultLegacy(parserYaml);
|
|
96
95
|
var globals__default = /*#__PURE__*/_interopDefaultLegacy(globals);
|
|
96
|
+
var tseslint__default = /*#__PURE__*/_interopDefaultLegacy(tseslint);
|
|
97
97
|
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
98
98
|
var gitignore__default = /*#__PURE__*/_interopDefaultLegacy(gitignore);
|
|
99
99
|
|
|
@@ -193,6 +193,11 @@ const GLOB_EXCLUDE = [
|
|
|
193
193
|
const formatting = (options) => {
|
|
194
194
|
var _a, _b;
|
|
195
195
|
return [
|
|
196
|
+
{
|
|
197
|
+
plugins: {
|
|
198
|
+
style: pluginStylistic__default["default"]
|
|
199
|
+
}
|
|
200
|
+
},
|
|
196
201
|
{
|
|
197
202
|
rules: {
|
|
198
203
|
"so1ve/no-useless-template-string": "error",
|
|
@@ -200,8 +205,8 @@ const formatting = (options) => {
|
|
|
200
205
|
"so1ve/no-import-promises-as": "error",
|
|
201
206
|
"so1ve/pad-after-last-import": "error",
|
|
202
207
|
"so1ve/function-style": "error",
|
|
203
|
-
"quote-props": ["error", "consistent-as-needed"],
|
|
204
|
-
"padding-line-between-statements": [
|
|
208
|
+
"style/quote-props": ["error", "consistent-as-needed"],
|
|
209
|
+
"style/padding-line-between-statements": [
|
|
205
210
|
"error",
|
|
206
211
|
{ blankLine: "always", prev: "*", next: "return" }
|
|
207
212
|
]
|
|
@@ -1058,14 +1063,14 @@ function typescript({
|
|
|
1058
1063
|
// Install the plugins without globs, so they can be configured separately.
|
|
1059
1064
|
plugins: {
|
|
1060
1065
|
import: pluginImport__default["default"],
|
|
1061
|
-
ts:
|
|
1066
|
+
ts: tseslint__default["default"].plugin,
|
|
1062
1067
|
etc: pluginEtc__default["default"]
|
|
1063
1068
|
}
|
|
1064
1069
|
},
|
|
1065
1070
|
{
|
|
1066
1071
|
files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
1067
1072
|
languageOptions: {
|
|
1068
|
-
parser:
|
|
1073
|
+
parser: tseslint__default["default"].parser,
|
|
1069
1074
|
parserOptions: {
|
|
1070
1075
|
sourceType: "module",
|
|
1071
1076
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
@@ -1082,12 +1087,12 @@ function typescript({
|
|
|
1082
1087
|
},
|
|
1083
1088
|
rules: {
|
|
1084
1089
|
...renameRules(
|
|
1085
|
-
|
|
1090
|
+
tseslint__default["default"].configs.eslintRecommended.rules,
|
|
1086
1091
|
"@typescript-eslint/",
|
|
1087
1092
|
"ts/"
|
|
1088
1093
|
),
|
|
1089
1094
|
...renameRules(
|
|
1090
|
-
|
|
1095
|
+
tseslint__default["default"].configs.recommended.map((config) => config.rules).filter(Boolean).reduce((a, b) => ({ ...a, ...b }), {}),
|
|
1091
1096
|
"@typescript-eslint/",
|
|
1092
1097
|
"ts/"
|
|
1093
1098
|
),
|
|
@@ -1159,6 +1164,9 @@ function typescript({
|
|
|
1159
1164
|
"ts/consistent-type-definitions": ["error", "interface"],
|
|
1160
1165
|
"ts/consistent-indexed-object-style": ["error", "record"],
|
|
1161
1166
|
"ts/prefer-ts-expect-error": "error",
|
|
1167
|
+
"ts/prefer-for-of": "error",
|
|
1168
|
+
"ts/no-duplicate-enum-values": "error",
|
|
1169
|
+
"ts/no-non-null-asserted-nullish-coalescing": "error",
|
|
1162
1170
|
"ts/no-require-imports": "error",
|
|
1163
1171
|
"ts/method-signature-style": ["error", "property"],
|
|
1164
1172
|
"ts/explicit-member-accessibility": [
|
|
@@ -1208,9 +1216,6 @@ function typescript({
|
|
|
1208
1216
|
"ts/no-non-null-assertion": "off",
|
|
1209
1217
|
"ts/explicit-module-boundary-types": "off",
|
|
1210
1218
|
"ts/triple-slash-reference": "off",
|
|
1211
|
-
"ts/prefer-for-of": "error",
|
|
1212
|
-
"ts/no-duplicate-enum-values": "error",
|
|
1213
|
-
"ts/no-non-null-asserted-nullish-coalescing": "error",
|
|
1214
1219
|
// handled by unused-imports/no-unused-imports
|
|
1215
1220
|
"ts/no-unused-vars": "off",
|
|
1216
1221
|
...overrides
|
|
@@ -1220,7 +1225,7 @@ function typescript({
|
|
|
1220
1225
|
files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
1221
1226
|
ignores: [GLOB_MARKDOWN_CODE],
|
|
1222
1227
|
languageOptions: {
|
|
1223
|
-
parser:
|
|
1228
|
+
parser: tseslint__default["default"].parser,
|
|
1224
1229
|
parserOptions: {
|
|
1225
1230
|
sourceType: "module",
|
|
1226
1231
|
// EXPERIMENTAL_useProjectService: true,
|
|
@@ -1329,7 +1334,7 @@ const vue = ({
|
|
|
1329
1334
|
jsx: true
|
|
1330
1335
|
},
|
|
1331
1336
|
extraFileExtensions: [".vue"],
|
|
1332
|
-
parser: typescript ?
|
|
1337
|
+
parser: typescript ? tseslint__default["default"].parser : null,
|
|
1333
1338
|
sourceType: "module"
|
|
1334
1339
|
}
|
|
1335
1340
|
},
|
|
@@ -1341,7 +1346,7 @@ const vue = ({
|
|
|
1341
1346
|
...pluginVue__default["default"].configs["vue3-recommended"].rules,
|
|
1342
1347
|
"no-unused-vars": "off",
|
|
1343
1348
|
"no-undef": "off",
|
|
1344
|
-
"
|
|
1349
|
+
"ts/no-unused-vars": "off",
|
|
1345
1350
|
"vue/no-v-html": "off",
|
|
1346
1351
|
"vue/require-prop-types": "off",
|
|
1347
1352
|
"vue/require-default-prop": "off",
|
|
@@ -1674,13 +1679,9 @@ Object.defineProperty(exports, 'pluginSortImports', {
|
|
|
1674
1679
|
enumerable: true,
|
|
1675
1680
|
get: function () { return pluginSortImports__default["default"]; }
|
|
1676
1681
|
});
|
|
1677
|
-
Object.defineProperty(exports, '
|
|
1678
|
-
enumerable: true,
|
|
1679
|
-
get: function () { return pluginTs__default["default"]; }
|
|
1680
|
-
});
|
|
1681
|
-
Object.defineProperty(exports, 'parserTs', {
|
|
1682
|
+
Object.defineProperty(exports, 'pluginStylistic', {
|
|
1682
1683
|
enumerable: true,
|
|
1683
|
-
get: function () { return
|
|
1684
|
+
get: function () { return pluginStylistic__default["default"]; }
|
|
1684
1685
|
});
|
|
1685
1686
|
Object.defineProperty(exports, 'parserMdx', {
|
|
1686
1687
|
enumerable: true,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import so1vePlugin from '@so1ve/eslint-plugin';
|
|
2
2
|
export { default as pluginSo1ve } from '@so1ve/eslint-plugin';
|
|
3
3
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
4
|
-
export { default as parserTs } from '@typescript-eslint/parser';
|
|
5
4
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
6
5
|
import { Rules, FlatESLintConfigItem } from 'eslint-define-config';
|
|
7
6
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
8
7
|
export { default as pluginHtml } from '@html-eslint/eslint-plugin';
|
|
9
8
|
export { default as parserHtml } from '@html-eslint/parser';
|
|
10
9
|
export { default as pluginSortImports } from '@so1ve/eslint-plugin-sort-imports';
|
|
11
|
-
export { default as
|
|
10
|
+
export { default as pluginStylistic } from '@stylistic/eslint-plugin';
|
|
12
11
|
export { default as parserMdx } from 'eslint-mdx';
|
|
13
12
|
export { default as pluginArrayFunc } from 'eslint-plugin-array-func';
|
|
14
13
|
export { default as pluginEtc } from 'eslint-plugin-etc';
|
package/dist/index.mjs
CHANGED
|
@@ -8,10 +8,8 @@ import pluginSo1ve from '@so1ve/eslint-plugin';
|
|
|
8
8
|
export { default as pluginSo1ve } from '@so1ve/eslint-plugin';
|
|
9
9
|
import pluginSortImports from '@so1ve/eslint-plugin-sort-imports';
|
|
10
10
|
export { default as pluginSortImports } from '@so1ve/eslint-plugin-sort-imports';
|
|
11
|
-
import
|
|
12
|
-
export { default as
|
|
13
|
-
import parserTs from '@typescript-eslint/parser';
|
|
14
|
-
export { default as parserTs } from '@typescript-eslint/parser';
|
|
11
|
+
import pluginStylistic from '@stylistic/eslint-plugin';
|
|
12
|
+
export { default as pluginStylistic } from '@stylistic/eslint-plugin';
|
|
15
13
|
export { default as parserMdx } from 'eslint-mdx';
|
|
16
14
|
import pluginArrayFunc from 'eslint-plugin-array-func';
|
|
17
15
|
export { default as pluginArrayFunc } from 'eslint-plugin-array-func';
|
|
@@ -64,6 +62,7 @@ export { default as parserVue } from 'vue-eslint-parser';
|
|
|
64
62
|
import parserYaml from 'yaml-eslint-parser';
|
|
65
63
|
export { default as parserYaml } from 'yaml-eslint-parser';
|
|
66
64
|
import globals from 'globals';
|
|
65
|
+
import tseslint from 'typescript-eslint';
|
|
67
66
|
import fs from 'node:fs';
|
|
68
67
|
import gitignore from 'eslint-config-flat-gitignore';
|
|
69
68
|
import { isPackageExists } from 'local-pkg';
|
|
@@ -164,6 +163,11 @@ const GLOB_EXCLUDE = [
|
|
|
164
163
|
const formatting = (options) => {
|
|
165
164
|
var _a, _b;
|
|
166
165
|
return [
|
|
166
|
+
{
|
|
167
|
+
plugins: {
|
|
168
|
+
style: pluginStylistic
|
|
169
|
+
}
|
|
170
|
+
},
|
|
167
171
|
{
|
|
168
172
|
rules: {
|
|
169
173
|
"so1ve/no-useless-template-string": "error",
|
|
@@ -171,8 +175,8 @@ const formatting = (options) => {
|
|
|
171
175
|
"so1ve/no-import-promises-as": "error",
|
|
172
176
|
"so1ve/pad-after-last-import": "error",
|
|
173
177
|
"so1ve/function-style": "error",
|
|
174
|
-
"quote-props": ["error", "consistent-as-needed"],
|
|
175
|
-
"padding-line-between-statements": [
|
|
178
|
+
"style/quote-props": ["error", "consistent-as-needed"],
|
|
179
|
+
"style/padding-line-between-statements": [
|
|
176
180
|
"error",
|
|
177
181
|
{ blankLine: "always", prev: "*", next: "return" }
|
|
178
182
|
]
|
|
@@ -1029,14 +1033,14 @@ function typescript({
|
|
|
1029
1033
|
// Install the plugins without globs, so they can be configured separately.
|
|
1030
1034
|
plugins: {
|
|
1031
1035
|
import: pluginImport,
|
|
1032
|
-
ts:
|
|
1036
|
+
ts: tseslint.plugin,
|
|
1033
1037
|
etc: pluginEtc
|
|
1034
1038
|
}
|
|
1035
1039
|
},
|
|
1036
1040
|
{
|
|
1037
1041
|
files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
1038
1042
|
languageOptions: {
|
|
1039
|
-
parser:
|
|
1043
|
+
parser: tseslint.parser,
|
|
1040
1044
|
parserOptions: {
|
|
1041
1045
|
sourceType: "module",
|
|
1042
1046
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
@@ -1053,12 +1057,12 @@ function typescript({
|
|
|
1053
1057
|
},
|
|
1054
1058
|
rules: {
|
|
1055
1059
|
...renameRules(
|
|
1056
|
-
|
|
1060
|
+
tseslint.configs.eslintRecommended.rules,
|
|
1057
1061
|
"@typescript-eslint/",
|
|
1058
1062
|
"ts/"
|
|
1059
1063
|
),
|
|
1060
1064
|
...renameRules(
|
|
1061
|
-
|
|
1065
|
+
tseslint.configs.recommended.map((config) => config.rules).filter(Boolean).reduce((a, b) => ({ ...a, ...b }), {}),
|
|
1062
1066
|
"@typescript-eslint/",
|
|
1063
1067
|
"ts/"
|
|
1064
1068
|
),
|
|
@@ -1130,6 +1134,9 @@ function typescript({
|
|
|
1130
1134
|
"ts/consistent-type-definitions": ["error", "interface"],
|
|
1131
1135
|
"ts/consistent-indexed-object-style": ["error", "record"],
|
|
1132
1136
|
"ts/prefer-ts-expect-error": "error",
|
|
1137
|
+
"ts/prefer-for-of": "error",
|
|
1138
|
+
"ts/no-duplicate-enum-values": "error",
|
|
1139
|
+
"ts/no-non-null-asserted-nullish-coalescing": "error",
|
|
1133
1140
|
"ts/no-require-imports": "error",
|
|
1134
1141
|
"ts/method-signature-style": ["error", "property"],
|
|
1135
1142
|
"ts/explicit-member-accessibility": [
|
|
@@ -1179,9 +1186,6 @@ function typescript({
|
|
|
1179
1186
|
"ts/no-non-null-assertion": "off",
|
|
1180
1187
|
"ts/explicit-module-boundary-types": "off",
|
|
1181
1188
|
"ts/triple-slash-reference": "off",
|
|
1182
|
-
"ts/prefer-for-of": "error",
|
|
1183
|
-
"ts/no-duplicate-enum-values": "error",
|
|
1184
|
-
"ts/no-non-null-asserted-nullish-coalescing": "error",
|
|
1185
1189
|
// handled by unused-imports/no-unused-imports
|
|
1186
1190
|
"ts/no-unused-vars": "off",
|
|
1187
1191
|
...overrides
|
|
@@ -1191,7 +1195,7 @@ function typescript({
|
|
|
1191
1195
|
files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
1192
1196
|
ignores: [GLOB_MARKDOWN_CODE],
|
|
1193
1197
|
languageOptions: {
|
|
1194
|
-
parser:
|
|
1198
|
+
parser: tseslint.parser,
|
|
1195
1199
|
parserOptions: {
|
|
1196
1200
|
sourceType: "module",
|
|
1197
1201
|
// EXPERIMENTAL_useProjectService: true,
|
|
@@ -1300,7 +1304,7 @@ const vue = ({
|
|
|
1300
1304
|
jsx: true
|
|
1301
1305
|
},
|
|
1302
1306
|
extraFileExtensions: [".vue"],
|
|
1303
|
-
parser: typescript ?
|
|
1307
|
+
parser: typescript ? tseslint.parser : null,
|
|
1304
1308
|
sourceType: "module"
|
|
1305
1309
|
}
|
|
1306
1310
|
},
|
|
@@ -1312,7 +1316,7 @@ const vue = ({
|
|
|
1312
1316
|
...pluginVue.configs["vue3-recommended"].rules,
|
|
1313
1317
|
"no-unused-vars": "off",
|
|
1314
1318
|
"no-undef": "off",
|
|
1315
|
-
"
|
|
1319
|
+
"ts/no-unused-vars": "off",
|
|
1316
1320
|
"vue/no-v-html": "off",
|
|
1317
1321
|
"vue/require-prop-types": "off",
|
|
1318
1322
|
"vue/require-default-prop": "off",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@so1ve/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
|
|
5
5
|
"description": "Ray's eslint config.",
|
|
6
6
|
"keywords": [
|
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.0.0",
|
|
36
36
|
"@html-eslint/eslint-plugin": "^0.19.1",
|
|
37
37
|
"@html-eslint/parser": "^0.19.1",
|
|
38
|
-
"@
|
|
39
|
-
"@typescript-eslint/parser": "^6.2.0",
|
|
38
|
+
"@stylistic/eslint-plugin": "^1.6.0",
|
|
40
39
|
"@unocss/eslint-config": "^0.55.0",
|
|
41
40
|
"eslint-config-flat-gitignore": "^0.1.0",
|
|
42
41
|
"eslint-define-config": "^1.21.0",
|
|
@@ -69,12 +68,14 @@
|
|
|
69
68
|
"jsonc-eslint-parser": "^2.3.0",
|
|
70
69
|
"local-pkg": "^0.5.0",
|
|
71
70
|
"toml-eslint-parser": "^0.6.0",
|
|
71
|
+
"typescript-eslint": "^7.0.1",
|
|
72
72
|
"vue-eslint-parser": "^9.3.1",
|
|
73
73
|
"yaml-eslint-parser": "^1.2.2",
|
|
74
|
-
"@so1ve/eslint-plugin": "1.
|
|
75
|
-
"@so1ve/eslint-plugin-sort-imports": "1.
|
|
74
|
+
"@so1ve/eslint-plugin": "1.4.0",
|
|
75
|
+
"@so1ve/eslint-plugin-sort-imports": "1.4.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
+
"@typescript-eslint/utils": "^6.2.0",
|
|
78
79
|
"eslint": "^8.46.0"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|