@lincy/eslint-config 3.2.0 → 3.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/dist/index.cjs CHANGED
@@ -274,7 +274,10 @@ function ignores(options = {}) {
274
274
  }
275
275
 
276
276
  // src/configs/imports.ts
277
- function imports() {
277
+ function imports(options = {}) {
278
+ const {
279
+ stylistic: stylistic2 = true
280
+ } = options;
278
281
  return [
279
282
  {
280
283
  plugins: {
@@ -283,13 +286,15 @@ function imports() {
283
286
  rules: {
284
287
  "import/export": "error",
285
288
  "import/first": "error",
286
- "import/newline-after-import": ["error", { considerComments: true, count: 1 }],
287
289
  "import/no-duplicates": "error",
288
290
  "import/no-mutable-exports": "error",
289
291
  "import/no-named-default": "error",
290
292
  "import/no-self-import": "error",
291
293
  "import/no-webpack-loader-syntax": "error",
292
- "import/order": "error"
294
+ "import/order": "error",
295
+ ...stylistic2 ? {
296
+ "import/newline-after-import": ["error", { considerComments: true, count: 1 }]
297
+ } : {}
293
298
  }
294
299
  }
295
300
  ];
@@ -534,7 +539,10 @@ function javascript(options = {}) {
534
539
  }
535
540
 
536
541
  // src/configs/jsdoc.ts
537
- function jsdoc() {
542
+ function jsdoc(options = {}) {
543
+ const {
544
+ stylistic: stylistic2 = true
545
+ } = options;
538
546
  return [
539
547
  {
540
548
  plugins: {
@@ -542,16 +550,13 @@ function jsdoc() {
542
550
  },
543
551
  rules: {
544
552
  "jsdoc/check-access": "warn",
545
- "jsdoc/check-alignment": "warn",
546
553
  "jsdoc/check-param-names": "warn",
547
554
  "jsdoc/check-property-names": "warn",
548
555
  "jsdoc/check-types": "warn",
549
556
  "jsdoc/empty-tags": "warn",
550
557
  "jsdoc/implements-on-classes": "warn",
551
- "jsdoc/multiline-blocks": "warn",
552
558
  "jsdoc/no-defaults": "warn",
553
559
  "jsdoc/no-multi-asterisks": "warn",
554
- "jsdoc/no-types": "warn",
555
560
  "jsdoc/require-param-name": "warn",
556
561
  "jsdoc/require-property": "warn",
557
562
  "jsdoc/require-property-description": "warn",
@@ -559,14 +564,22 @@ function jsdoc() {
559
564
  "jsdoc/require-returns-check": "warn",
560
565
  "jsdoc/require-returns-description": "warn",
561
566
  "jsdoc/require-yields-check": "warn",
562
- "jsdoc/valid-types": "warn"
567
+ "jsdoc/valid-types": "warn",
568
+ ...stylistic2 ? {
569
+ "jsdoc/check-alignment": "warn",
570
+ "jsdoc/multiline-blocks": "warn"
571
+ } : {}
563
572
  }
564
573
  }
565
574
  ];
566
575
  }
567
576
 
568
577
  // src/configs/jsonc.ts
569
- function jsonc() {
578
+ function jsonc(options = {}) {
579
+ const {
580
+ stylistic: stylistic2 = true,
581
+ overrides = {}
582
+ } = options;
570
583
  return [
571
584
  {
572
585
  plugins: {
@@ -579,11 +592,6 @@ function jsonc() {
579
592
  parser: import_jsonc_eslint_parser.default
580
593
  },
581
594
  rules: {
582
- "jsonc/array-bracket-spacing": ["error", "never"],
583
- "jsonc/comma-dangle": ["error", "never"],
584
- "jsonc/comma-style": ["error", "last"],
585
- "jsonc/indent": ["error", 2],
586
- "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
587
595
  "jsonc/no-bigint-literals": "error",
588
596
  "jsonc/no-binary-expression": "error",
589
597
  "jsonc/no-binary-numeric-literals": "error",
@@ -607,14 +615,22 @@ function jsonc() {
607
615
  "jsonc/no-undefined-value": "error",
608
616
  "jsonc/no-unicode-codepoint-escapes": "error",
609
617
  "jsonc/no-useless-escape": "error",
610
- "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
611
- "jsonc/object-curly-spacing": ["error", "always"],
612
- "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
613
- "jsonc/quote-props": "error",
614
- "jsonc/quotes": "error",
615
618
  "jsonc/space-unary-ops": "error",
616
619
  "jsonc/valid-json-number": "error",
617
- "jsonc/vue-custom-block/no-parsing-error": "error"
620
+ "jsonc/vue-custom-block/no-parsing-error": "error",
621
+ ...stylistic2 ? {
622
+ "jsonc/array-bracket-spacing": ["error", "never"],
623
+ "jsonc/comma-dangle": ["error", "never"],
624
+ "jsonc/comma-style": ["error", "last"],
625
+ "jsonc/indent": ["error", 2],
626
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
627
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
628
+ "jsonc/object-curly-spacing": ["error", "always"],
629
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
630
+ "jsonc/quote-props": "error",
631
+ "jsonc/quotes": "error"
632
+ } : {},
633
+ ...overrides
618
634
  }
619
635
  }
620
636
  ];
@@ -976,7 +992,7 @@ function stylistic(options = {}) {
976
992
  "style/keyword-spacing": ["error", { after: true, before: true }],
977
993
  "style/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
978
994
  "style/member-delimiter-style": ["error", { multiline: { delimiter: "none" } }],
979
- "style/multiline-ternary": ["error", "always-multiline"],
995
+ "style/multiline-ternary": ["error", "never"],
980
996
  "style/no-mixed-spaces-and-tabs": "error",
981
997
  "style/no-multi-spaces": "error",
982
998
  "style/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
@@ -1250,7 +1266,8 @@ vueVersion = vueVersion && vueVersion[0];
1250
1266
  vueVersion = Number.isNaN(vueVersion) ? "3" : vueVersion;
1251
1267
  function vue(options = {}) {
1252
1268
  const {
1253
- overrides = {}
1269
+ overrides = {},
1270
+ stylistic: stylistic2 = true
1254
1271
  } = options;
1255
1272
  return [
1256
1273
  {
@@ -1284,20 +1301,9 @@ function vue(options = {}) {
1284
1301
  ...import_eslint_plugin_vue.default.configs.recommended.rules
1285
1302
  },
1286
1303
  "node/prefer-global/process": OFF,
1287
- "vue/array-bracket-spacing": ["error", "never"],
1288
- "vue/arrow-spacing": ["error", { after: true, before: true }],
1289
1304
  "vue/block-order": ["error", {
1290
1305
  order: ["template", "script", "style"]
1291
1306
  }],
1292
- "vue/block-spacing": ["error", "always"],
1293
- "vue/block-tag-newline": ["error", {
1294
- multiline: "always",
1295
- singleline: "always"
1296
- }],
1297
- "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1298
- "vue/comma-dangle": ["error", "always-multiline"],
1299
- "vue/comma-spacing": ["error", { after: true, before: false }],
1300
- "vue/comma-style": ["error", "last"],
1301
1307
  "vue/component-name-in-template-casing": ["error", "PascalCase"],
1302
1308
  "vue/component-options-name-casing": ["error", "PascalCase"],
1303
1309
  "vue/custom-event-name-casing": vueVersion === "3" ? ["error", "camelCase"] : ["error", "kebab-case"],
@@ -1308,9 +1314,6 @@ function vue(options = {}) {
1308
1314
  "vue/dot-location": ["error", "property"],
1309
1315
  "vue/dot-notation": ["error", { allowKeywords: true }],
1310
1316
  "vue/eqeqeq": ["error", "smart"],
1311
- "vue/html-comment-content-spacing": ["error", "always", {
1312
- exceptions: ["-"]
1313
- }],
1314
1317
  "vue/html-indent": ["error", 4, {
1315
1318
  alignAttributesVertically: true,
1316
1319
  attribute: 1,
@@ -1327,8 +1330,6 @@ function vue(options = {}) {
1327
1330
  math: "always",
1328
1331
  svg: "always"
1329
1332
  }],
1330
- "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1331
- "vue/keyword-spacing": ["error", { after: true, before: true }],
1332
1333
  "vue/max-attributes-per-line": OFF,
1333
1334
  "vue/multi-word-component-names": OFF,
1334
1335
  "vue/no-constant-condition": "warn",
@@ -1350,9 +1351,6 @@ function vue(options = {}) {
1350
1351
  "vue/no-useless-v-bind": "error",
1351
1352
  "vue/no-v-html": OFF,
1352
1353
  "vue/no-v-text-v-html-on-component": OFF,
1353
- "vue/object-curly-newline": ["error", { consistent: true, multiline: true }],
1354
- "vue/object-curly-spacing": ["error", "always"],
1355
- "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1356
1354
  "vue/object-shorthand": [
1357
1355
  "error",
1358
1356
  "always",
@@ -1361,18 +1359,39 @@ function vue(options = {}) {
1361
1359
  ignoreConstructors: false
1362
1360
  }
1363
1361
  ],
1364
- "vue/operator-linebreak": ["error", "before"],
1365
- "vue/padding-line-between-blocks": ["error", "always"],
1366
1362
  "vue/prefer-separate-static-class": "error",
1367
1363
  "vue/prefer-template": "error",
1368
- "vue/quote-props": ["error", "consistent-as-needed"],
1369
1364
  "vue/require-default-prop": OFF,
1370
1365
  "vue/require-prop-types": OFF,
1371
1366
  "vue/singleline-html-element-content-newline": "off",
1372
- "vue/space-in-parens": ["error", "never"],
1373
1367
  "vue/space-infix-ops": "error",
1374
1368
  "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
1375
- "vue/template-curly-spacing": "error",
1369
+ ...stylistic2 ? {
1370
+ "vue/array-bracket-spacing": ["error", "never"],
1371
+ "vue/arrow-spacing": ["error", { after: true, before: true }],
1372
+ "vue/block-spacing": ["error", "always"],
1373
+ "vue/block-tag-newline": ["error", {
1374
+ multiline: "always",
1375
+ singleline: "always"
1376
+ }],
1377
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1378
+ "vue/comma-dangle": ["error", "always-multiline"],
1379
+ "vue/comma-spacing": ["error", { after: true, before: false }],
1380
+ "vue/comma-style": ["error", "last"],
1381
+ "vue/html-comment-content-spacing": ["error", "always", {
1382
+ exceptions: ["-"]
1383
+ }],
1384
+ "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1385
+ "vue/keyword-spacing": ["error", { after: true, before: true }],
1386
+ "vue/object-curly-newline": OFF,
1387
+ "vue/object-curly-spacing": ["error", "always"],
1388
+ "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1389
+ "vue/operator-linebreak": ["error", "before"],
1390
+ "vue/padding-line-between-blocks": ["error", "always"],
1391
+ "vue/quote-props": ["error", "consistent-as-needed"],
1392
+ "vue/space-in-parens": ["error", "never"],
1393
+ "vue/template-curly-spacing": "error"
1394
+ } : {},
1376
1395
  ...overrides
1377
1396
  }
1378
1397
  }
@@ -1382,7 +1401,8 @@ function vue(options = {}) {
1382
1401
  // src/configs/yaml.ts
1383
1402
  function yaml(options = {}) {
1384
1403
  const {
1385
- overrides = {}
1404
+ overrides = {},
1405
+ stylistic: stylistic2 = true
1386
1406
  } = options;
1387
1407
  return [
1388
1408
  {
@@ -1398,23 +1418,25 @@ function yaml(options = {}) {
1398
1418
  rules: {
1399
1419
  "style/spaced-comment": OFF,
1400
1420
  "yaml/block-mapping": "error",
1401
- "yaml/block-mapping-question-indicator-newline": "error",
1402
1421
  "yaml/block-sequence": "error",
1403
- "yaml/block-sequence-hyphen-indicator-newline": "error",
1404
- "yaml/flow-mapping-curly-newline": "error",
1405
- "yaml/flow-mapping-curly-spacing": "error",
1406
- "yaml/flow-sequence-bracket-newline": "error",
1407
- "yaml/flow-sequence-bracket-spacing": "error",
1408
- "yaml/indent": ["error", 2],
1409
- "yaml/key-spacing": "error",
1410
1422
  "yaml/no-empty-key": "error",
1411
1423
  "yaml/no-empty-sequence-entry": "error",
1412
1424
  "yaml/no-irregular-whitespace": "error",
1413
- "yaml/no-tab-indent": "error",
1414
1425
  "yaml/plain-scalar": "error",
1415
- "yaml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
1416
- "yaml/spaced-comment": "error",
1417
1426
  "yaml/vue-custom-block/no-parsing-error": "error",
1427
+ ...stylistic2 ? {
1428
+ "yaml/block-mapping-question-indicator-newline": "error",
1429
+ "yaml/block-sequence-hyphen-indicator-newline": "error",
1430
+ "yaml/flow-mapping-curly-newline": "error",
1431
+ "yaml/flow-mapping-curly-spacing": "error",
1432
+ "yaml/flow-sequence-bracket-newline": "error",
1433
+ "yaml/flow-sequence-bracket-spacing": "error",
1434
+ "yaml/indent": ["error", 2],
1435
+ "yaml/key-spacing": "error",
1436
+ "yaml/no-tab-indent": "error",
1437
+ "yaml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
1438
+ "yaml/spaced-comment": "error"
1439
+ } : {},
1418
1440
  ...overrides
1419
1441
  }
1420
1442
  }
@@ -1488,8 +1510,12 @@ function lincy(options = {}, ...userConfigs) {
1488
1510
  }),
1489
1511
  comments(),
1490
1512
  node(),
1491
- jsdoc(),
1492
- imports(),
1513
+ jsdoc({
1514
+ stylistic: enableStylistic
1515
+ }),
1516
+ imports({
1517
+ stylistic: enableStylistic
1518
+ }),
1493
1519
  unicorn()
1494
1520
  );
1495
1521
  const componentExts = [];
@@ -1508,8 +1534,11 @@ function lincy(options = {}, ...userConfigs) {
1508
1534
  }));
1509
1535
  }
1510
1536
  }
1511
- if (enableStylistic)
1512
- configs.push(stylistic());
1537
+ if (enableStylistic) {
1538
+ configs.push(stylistic({
1539
+ overrides: overrides.stylistic
1540
+ }));
1541
+ }
1513
1542
  if (options.test ?? true) {
1514
1543
  configs.push(test({
1515
1544
  isInEditor,
@@ -1519,18 +1548,26 @@ function lincy(options = {}, ...userConfigs) {
1519
1548
  if (enableVue) {
1520
1549
  configs.push(vue({
1521
1550
  overrides: overrides.vue,
1551
+ stylistic: enableStylistic,
1522
1552
  typescript: !!enableTypeScript
1523
1553
  }));
1524
1554
  }
1525
1555
  if (options.jsonc ?? true) {
1526
1556
  configs.push(
1527
- jsonc(),
1557
+ jsonc({
1558
+ overrides: overrides.jsonc,
1559
+ stylistic: enableStylistic
1560
+ }),
1528
1561
  sortPackageJson(),
1529
1562
  sortTsconfig()
1530
1563
  );
1531
1564
  }
1532
- if (options.yaml ?? true)
1533
- configs.push(yaml());
1565
+ if (options.yaml ?? true) {
1566
+ configs.push(yaml({
1567
+ overrides: overrides.yaml,
1568
+ stylistic: enableStylistic
1569
+ }));
1570
+ }
1534
1571
  if (options.markdown ?? true) {
1535
1572
  configs.push(markdown({
1536
1573
  componentExts,
package/dist/index.d.cts CHANGED
@@ -35,6 +35,9 @@ interface OptionsTypeScriptWithTypes {
35
35
  interface OptionsHasTypeScript {
36
36
  typescript?: boolean;
37
37
  }
38
+ interface OptionsStylistic {
39
+ stylistic?: boolean;
40
+ }
38
41
  interface OptionsOverrides {
39
42
  overrides?: FlatESLintConfigItem['rules'];
40
43
  ignores?: string[];
@@ -127,13 +130,13 @@ declare function comments(): FlatESLintConfigItem[];
127
130
 
128
131
  declare function ignores(options?: OptionsOverrides): FlatESLintConfigItem[];
129
132
 
130
- declare function imports(): FlatESLintConfigItem[];
133
+ declare function imports(options?: OptionsStylistic): FlatESLintConfigItem[];
131
134
 
132
135
  declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
133
136
 
134
- declare function jsdoc(): FlatESLintConfigItem[];
137
+ declare function jsdoc(options?: OptionsStylistic): FlatESLintConfigItem[];
135
138
 
136
- declare function jsonc(): FlatESLintConfigItem[];
139
+ declare function jsonc(options?: OptionsStylistic & OptionsOverrides): FlatESLintConfigItem[];
137
140
 
138
141
  declare function markdown(options?: OptionsComponentExts & OptionsOverrides): FlatESLintConfigItem[];
139
142
 
@@ -159,9 +162,9 @@ declare function typescriptWithTypes(options: OptionsTypeScriptWithTypes & Optio
159
162
 
160
163
  declare function unicorn(): FlatESLintConfigItem[];
161
164
 
162
- declare function vue(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
165
+ declare function vue(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
163
166
 
164
- declare function yaml(options?: OptionsOverrides): FlatESLintConfigItem[];
167
+ declare function yaml(options?: OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
165
168
 
166
169
  declare function test(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
167
170
 
@@ -198,4 +201,4 @@ declare const GLOB_TESTS: string[];
198
201
  declare const GLOB_ALL_SRC: string[];
199
202
  declare const GLOB_EXCLUDE: string[];
200
203
 
201
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsTypeScriptWithTypes, combine, comments, lincy as default, ignores, imports, javascript, jsdoc, jsonc, lincy, markdown, node, recordRulesState, recordRulesStateConfigs, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, typescriptWithTypes, unicorn, vue, warnUnnecessaryOffRules, yaml };
204
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsStylistic, OptionsTypeScriptWithTypes, combine, comments, lincy as default, ignores, imports, javascript, jsdoc, jsonc, lincy, markdown, node, recordRulesState, recordRulesStateConfigs, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, typescriptWithTypes, unicorn, vue, warnUnnecessaryOffRules, yaml };
package/dist/index.d.ts CHANGED
@@ -35,6 +35,9 @@ interface OptionsTypeScriptWithTypes {
35
35
  interface OptionsHasTypeScript {
36
36
  typescript?: boolean;
37
37
  }
38
+ interface OptionsStylistic {
39
+ stylistic?: boolean;
40
+ }
38
41
  interface OptionsOverrides {
39
42
  overrides?: FlatESLintConfigItem['rules'];
40
43
  ignores?: string[];
@@ -127,13 +130,13 @@ declare function comments(): FlatESLintConfigItem[];
127
130
 
128
131
  declare function ignores(options?: OptionsOverrides): FlatESLintConfigItem[];
129
132
 
130
- declare function imports(): FlatESLintConfigItem[];
133
+ declare function imports(options?: OptionsStylistic): FlatESLintConfigItem[];
131
134
 
132
135
  declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
133
136
 
134
- declare function jsdoc(): FlatESLintConfigItem[];
137
+ declare function jsdoc(options?: OptionsStylistic): FlatESLintConfigItem[];
135
138
 
136
- declare function jsonc(): FlatESLintConfigItem[];
139
+ declare function jsonc(options?: OptionsStylistic & OptionsOverrides): FlatESLintConfigItem[];
137
140
 
138
141
  declare function markdown(options?: OptionsComponentExts & OptionsOverrides): FlatESLintConfigItem[];
139
142
 
@@ -159,9 +162,9 @@ declare function typescriptWithTypes(options: OptionsTypeScriptWithTypes & Optio
159
162
 
160
163
  declare function unicorn(): FlatESLintConfigItem[];
161
164
 
162
- declare function vue(options?: OptionsHasTypeScript & OptionsOverrides): FlatESLintConfigItem[];
165
+ declare function vue(options?: OptionsHasTypeScript & OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
163
166
 
164
- declare function yaml(options?: OptionsOverrides): FlatESLintConfigItem[];
167
+ declare function yaml(options?: OptionsOverrides & OptionsStylistic): FlatESLintConfigItem[];
165
168
 
166
169
  declare function test(options?: OptionsIsInEditor & OptionsOverrides): FlatESLintConfigItem[];
167
170
 
@@ -198,4 +201,4 @@ declare const GLOB_TESTS: string[];
198
201
  declare const GLOB_ALL_SRC: string[];
199
202
  declare const GLOB_EXCLUDE: string[];
200
203
 
201
- export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsTypeScriptWithTypes, combine, comments, lincy as default, ignores, imports, javascript, jsdoc, jsonc, lincy, markdown, node, recordRulesState, recordRulesStateConfigs, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, typescriptWithTypes, unicorn, vue, warnUnnecessaryOffRules, yaml };
204
+ export { GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsHasTypeScript, OptionsIsInEditor, OptionsOverrides, OptionsStylistic, OptionsTypeScriptWithTypes, combine, comments, lincy as default, ignores, imports, javascript, jsdoc, jsonc, lincy, markdown, node, recordRulesState, recordRulesStateConfigs, renameRules, sortPackageJson, sortTsconfig, stylistic, test, typescript, typescriptWithTypes, unicorn, vue, warnUnnecessaryOffRules, yaml };
package/dist/index.js CHANGED
@@ -172,7 +172,10 @@ function ignores(options = {}) {
172
172
  }
173
173
 
174
174
  // src/configs/imports.ts
175
- function imports() {
175
+ function imports(options = {}) {
176
+ const {
177
+ stylistic: stylistic2 = true
178
+ } = options;
176
179
  return [
177
180
  {
178
181
  plugins: {
@@ -181,13 +184,15 @@ function imports() {
181
184
  rules: {
182
185
  "import/export": "error",
183
186
  "import/first": "error",
184
- "import/newline-after-import": ["error", { considerComments: true, count: 1 }],
185
187
  "import/no-duplicates": "error",
186
188
  "import/no-mutable-exports": "error",
187
189
  "import/no-named-default": "error",
188
190
  "import/no-self-import": "error",
189
191
  "import/no-webpack-loader-syntax": "error",
190
- "import/order": "error"
192
+ "import/order": "error",
193
+ ...stylistic2 ? {
194
+ "import/newline-after-import": ["error", { considerComments: true, count: 1 }]
195
+ } : {}
191
196
  }
192
197
  }
193
198
  ];
@@ -432,7 +437,10 @@ function javascript(options = {}) {
432
437
  }
433
438
 
434
439
  // src/configs/jsdoc.ts
435
- function jsdoc() {
440
+ function jsdoc(options = {}) {
441
+ const {
442
+ stylistic: stylistic2 = true
443
+ } = options;
436
444
  return [
437
445
  {
438
446
  plugins: {
@@ -440,16 +448,13 @@ function jsdoc() {
440
448
  },
441
449
  rules: {
442
450
  "jsdoc/check-access": "warn",
443
- "jsdoc/check-alignment": "warn",
444
451
  "jsdoc/check-param-names": "warn",
445
452
  "jsdoc/check-property-names": "warn",
446
453
  "jsdoc/check-types": "warn",
447
454
  "jsdoc/empty-tags": "warn",
448
455
  "jsdoc/implements-on-classes": "warn",
449
- "jsdoc/multiline-blocks": "warn",
450
456
  "jsdoc/no-defaults": "warn",
451
457
  "jsdoc/no-multi-asterisks": "warn",
452
- "jsdoc/no-types": "warn",
453
458
  "jsdoc/require-param-name": "warn",
454
459
  "jsdoc/require-property": "warn",
455
460
  "jsdoc/require-property-description": "warn",
@@ -457,14 +462,22 @@ function jsdoc() {
457
462
  "jsdoc/require-returns-check": "warn",
458
463
  "jsdoc/require-returns-description": "warn",
459
464
  "jsdoc/require-yields-check": "warn",
460
- "jsdoc/valid-types": "warn"
465
+ "jsdoc/valid-types": "warn",
466
+ ...stylistic2 ? {
467
+ "jsdoc/check-alignment": "warn",
468
+ "jsdoc/multiline-blocks": "warn"
469
+ } : {}
461
470
  }
462
471
  }
463
472
  ];
464
473
  }
465
474
 
466
475
  // src/configs/jsonc.ts
467
- function jsonc() {
476
+ function jsonc(options = {}) {
477
+ const {
478
+ stylistic: stylistic2 = true,
479
+ overrides = {}
480
+ } = options;
468
481
  return [
469
482
  {
470
483
  plugins: {
@@ -477,11 +490,6 @@ function jsonc() {
477
490
  parser: default19
478
491
  },
479
492
  rules: {
480
- "jsonc/array-bracket-spacing": ["error", "never"],
481
- "jsonc/comma-dangle": ["error", "never"],
482
- "jsonc/comma-style": ["error", "last"],
483
- "jsonc/indent": ["error", 2],
484
- "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
485
493
  "jsonc/no-bigint-literals": "error",
486
494
  "jsonc/no-binary-expression": "error",
487
495
  "jsonc/no-binary-numeric-literals": "error",
@@ -505,14 +513,22 @@ function jsonc() {
505
513
  "jsonc/no-undefined-value": "error",
506
514
  "jsonc/no-unicode-codepoint-escapes": "error",
507
515
  "jsonc/no-useless-escape": "error",
508
- "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
509
- "jsonc/object-curly-spacing": ["error", "always"],
510
- "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
511
- "jsonc/quote-props": "error",
512
- "jsonc/quotes": "error",
513
516
  "jsonc/space-unary-ops": "error",
514
517
  "jsonc/valid-json-number": "error",
515
- "jsonc/vue-custom-block/no-parsing-error": "error"
518
+ "jsonc/vue-custom-block/no-parsing-error": "error",
519
+ ...stylistic2 ? {
520
+ "jsonc/array-bracket-spacing": ["error", "never"],
521
+ "jsonc/comma-dangle": ["error", "never"],
522
+ "jsonc/comma-style": ["error", "last"],
523
+ "jsonc/indent": ["error", 2],
524
+ "jsonc/key-spacing": ["error", { afterColon: true, beforeColon: false }],
525
+ "jsonc/object-curly-newline": ["error", { consistent: true, multiline: true }],
526
+ "jsonc/object-curly-spacing": ["error", "always"],
527
+ "jsonc/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
528
+ "jsonc/quote-props": "error",
529
+ "jsonc/quotes": "error"
530
+ } : {},
531
+ ...overrides
516
532
  }
517
533
  }
518
534
  ];
@@ -874,7 +890,7 @@ function stylistic(options = {}) {
874
890
  "style/keyword-spacing": ["error", { after: true, before: true }],
875
891
  "style/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
876
892
  "style/member-delimiter-style": ["error", { multiline: { delimiter: "none" } }],
877
- "style/multiline-ternary": ["error", "always-multiline"],
893
+ "style/multiline-ternary": ["error", "never"],
878
894
  "style/no-mixed-spaces-and-tabs": "error",
879
895
  "style/no-multi-spaces": "error",
880
896
  "style/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
@@ -1148,7 +1164,8 @@ vueVersion = vueVersion && vueVersion[0];
1148
1164
  vueVersion = Number.isNaN(vueVersion) ? "3" : vueVersion;
1149
1165
  function vue(options = {}) {
1150
1166
  const {
1151
- overrides = {}
1167
+ overrides = {},
1168
+ stylistic: stylistic2 = true
1152
1169
  } = options;
1153
1170
  return [
1154
1171
  {
@@ -1182,20 +1199,9 @@ function vue(options = {}) {
1182
1199
  ...default13.configs.recommended.rules
1183
1200
  },
1184
1201
  "node/prefer-global/process": OFF,
1185
- "vue/array-bracket-spacing": ["error", "never"],
1186
- "vue/arrow-spacing": ["error", { after: true, before: true }],
1187
1202
  "vue/block-order": ["error", {
1188
1203
  order: ["template", "script", "style"]
1189
1204
  }],
1190
- "vue/block-spacing": ["error", "always"],
1191
- "vue/block-tag-newline": ["error", {
1192
- multiline: "always",
1193
- singleline: "always"
1194
- }],
1195
- "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1196
- "vue/comma-dangle": ["error", "always-multiline"],
1197
- "vue/comma-spacing": ["error", { after: true, before: false }],
1198
- "vue/comma-style": ["error", "last"],
1199
1205
  "vue/component-name-in-template-casing": ["error", "PascalCase"],
1200
1206
  "vue/component-options-name-casing": ["error", "PascalCase"],
1201
1207
  "vue/custom-event-name-casing": vueVersion === "3" ? ["error", "camelCase"] : ["error", "kebab-case"],
@@ -1206,9 +1212,6 @@ function vue(options = {}) {
1206
1212
  "vue/dot-location": ["error", "property"],
1207
1213
  "vue/dot-notation": ["error", { allowKeywords: true }],
1208
1214
  "vue/eqeqeq": ["error", "smart"],
1209
- "vue/html-comment-content-spacing": ["error", "always", {
1210
- exceptions: ["-"]
1211
- }],
1212
1215
  "vue/html-indent": ["error", 4, {
1213
1216
  alignAttributesVertically: true,
1214
1217
  attribute: 1,
@@ -1225,8 +1228,6 @@ function vue(options = {}) {
1225
1228
  math: "always",
1226
1229
  svg: "always"
1227
1230
  }],
1228
- "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1229
- "vue/keyword-spacing": ["error", { after: true, before: true }],
1230
1231
  "vue/max-attributes-per-line": OFF,
1231
1232
  "vue/multi-word-component-names": OFF,
1232
1233
  "vue/no-constant-condition": "warn",
@@ -1248,9 +1249,6 @@ function vue(options = {}) {
1248
1249
  "vue/no-useless-v-bind": "error",
1249
1250
  "vue/no-v-html": OFF,
1250
1251
  "vue/no-v-text-v-html-on-component": OFF,
1251
- "vue/object-curly-newline": ["error", { consistent: true, multiline: true }],
1252
- "vue/object-curly-spacing": ["error", "always"],
1253
- "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1254
1252
  "vue/object-shorthand": [
1255
1253
  "error",
1256
1254
  "always",
@@ -1259,18 +1257,39 @@ function vue(options = {}) {
1259
1257
  ignoreConstructors: false
1260
1258
  }
1261
1259
  ],
1262
- "vue/operator-linebreak": ["error", "before"],
1263
- "vue/padding-line-between-blocks": ["error", "always"],
1264
1260
  "vue/prefer-separate-static-class": "error",
1265
1261
  "vue/prefer-template": "error",
1266
- "vue/quote-props": ["error", "consistent-as-needed"],
1267
1262
  "vue/require-default-prop": OFF,
1268
1263
  "vue/require-prop-types": OFF,
1269
1264
  "vue/singleline-html-element-content-newline": "off",
1270
- "vue/space-in-parens": ["error", "never"],
1271
1265
  "vue/space-infix-ops": "error",
1272
1266
  "vue/space-unary-ops": ["error", { nonwords: false, words: true }],
1273
- "vue/template-curly-spacing": "error",
1267
+ ...stylistic2 ? {
1268
+ "vue/array-bracket-spacing": ["error", "never"],
1269
+ "vue/arrow-spacing": ["error", { after: true, before: true }],
1270
+ "vue/block-spacing": ["error", "always"],
1271
+ "vue/block-tag-newline": ["error", {
1272
+ multiline: "always",
1273
+ singleline: "always"
1274
+ }],
1275
+ "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
1276
+ "vue/comma-dangle": ["error", "always-multiline"],
1277
+ "vue/comma-spacing": ["error", { after: true, before: false }],
1278
+ "vue/comma-style": ["error", "last"],
1279
+ "vue/html-comment-content-spacing": ["error", "always", {
1280
+ exceptions: ["-"]
1281
+ }],
1282
+ "vue/key-spacing": ["error", { afterColon: true, beforeColon: false }],
1283
+ "vue/keyword-spacing": ["error", { after: true, before: true }],
1284
+ "vue/object-curly-newline": OFF,
1285
+ "vue/object-curly-spacing": ["error", "always"],
1286
+ "vue/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
1287
+ "vue/operator-linebreak": ["error", "before"],
1288
+ "vue/padding-line-between-blocks": ["error", "always"],
1289
+ "vue/quote-props": ["error", "consistent-as-needed"],
1290
+ "vue/space-in-parens": ["error", "never"],
1291
+ "vue/template-curly-spacing": "error"
1292
+ } : {},
1274
1293
  ...overrides
1275
1294
  }
1276
1295
  }
@@ -1280,7 +1299,8 @@ function vue(options = {}) {
1280
1299
  // src/configs/yaml.ts
1281
1300
  function yaml(options = {}) {
1282
1301
  const {
1283
- overrides = {}
1302
+ overrides = {},
1303
+ stylistic: stylistic2 = true
1284
1304
  } = options;
1285
1305
  return [
1286
1306
  {
@@ -1296,23 +1316,25 @@ function yaml(options = {}) {
1296
1316
  rules: {
1297
1317
  "style/spaced-comment": OFF,
1298
1318
  "yaml/block-mapping": "error",
1299
- "yaml/block-mapping-question-indicator-newline": "error",
1300
1319
  "yaml/block-sequence": "error",
1301
- "yaml/block-sequence-hyphen-indicator-newline": "error",
1302
- "yaml/flow-mapping-curly-newline": "error",
1303
- "yaml/flow-mapping-curly-spacing": "error",
1304
- "yaml/flow-sequence-bracket-newline": "error",
1305
- "yaml/flow-sequence-bracket-spacing": "error",
1306
- "yaml/indent": ["error", 2],
1307
- "yaml/key-spacing": "error",
1308
1320
  "yaml/no-empty-key": "error",
1309
1321
  "yaml/no-empty-sequence-entry": "error",
1310
1322
  "yaml/no-irregular-whitespace": "error",
1311
- "yaml/no-tab-indent": "error",
1312
1323
  "yaml/plain-scalar": "error",
1313
- "yaml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
1314
- "yaml/spaced-comment": "error",
1315
1324
  "yaml/vue-custom-block/no-parsing-error": "error",
1325
+ ...stylistic2 ? {
1326
+ "yaml/block-mapping-question-indicator-newline": "error",
1327
+ "yaml/block-sequence-hyphen-indicator-newline": "error",
1328
+ "yaml/flow-mapping-curly-newline": "error",
1329
+ "yaml/flow-mapping-curly-spacing": "error",
1330
+ "yaml/flow-sequence-bracket-newline": "error",
1331
+ "yaml/flow-sequence-bracket-spacing": "error",
1332
+ "yaml/indent": ["error", 2],
1333
+ "yaml/key-spacing": "error",
1334
+ "yaml/no-tab-indent": "error",
1335
+ "yaml/quotes": ["error", { avoidEscape: false, prefer: "single" }],
1336
+ "yaml/spaced-comment": "error"
1337
+ } : {},
1316
1338
  ...overrides
1317
1339
  }
1318
1340
  }
@@ -1386,8 +1408,12 @@ function lincy(options = {}, ...userConfigs) {
1386
1408
  }),
1387
1409
  comments(),
1388
1410
  node(),
1389
- jsdoc(),
1390
- imports(),
1411
+ jsdoc({
1412
+ stylistic: enableStylistic
1413
+ }),
1414
+ imports({
1415
+ stylistic: enableStylistic
1416
+ }),
1391
1417
  unicorn()
1392
1418
  );
1393
1419
  const componentExts = [];
@@ -1406,8 +1432,11 @@ function lincy(options = {}, ...userConfigs) {
1406
1432
  }));
1407
1433
  }
1408
1434
  }
1409
- if (enableStylistic)
1410
- configs.push(stylistic());
1435
+ if (enableStylistic) {
1436
+ configs.push(stylistic({
1437
+ overrides: overrides.stylistic
1438
+ }));
1439
+ }
1411
1440
  if (options.test ?? true) {
1412
1441
  configs.push(test({
1413
1442
  isInEditor,
@@ -1417,18 +1446,26 @@ function lincy(options = {}, ...userConfigs) {
1417
1446
  if (enableVue) {
1418
1447
  configs.push(vue({
1419
1448
  overrides: overrides.vue,
1449
+ stylistic: enableStylistic,
1420
1450
  typescript: !!enableTypeScript
1421
1451
  }));
1422
1452
  }
1423
1453
  if (options.jsonc ?? true) {
1424
1454
  configs.push(
1425
- jsonc(),
1455
+ jsonc({
1456
+ overrides: overrides.jsonc,
1457
+ stylistic: enableStylistic
1458
+ }),
1426
1459
  sortPackageJson(),
1427
1460
  sortTsconfig()
1428
1461
  );
1429
1462
  }
1430
- if (options.yaml ?? true)
1431
- configs.push(yaml());
1463
+ if (options.yaml ?? true) {
1464
+ configs.push(yaml({
1465
+ overrides: overrides.yaml,
1466
+ stylistic: enableStylistic
1467
+ }));
1468
+ }
1432
1469
  if (options.markdown ?? true) {
1433
1470
  configs.push(markdown({
1434
1471
  componentExts,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lincy/eslint-config",
3
3
  "type": "module",
4
- "version": "3.2.0",
4
+ "version": "3.3.0",
5
5
  "packageManager": "pnpm@8.7.6",
6
6
  "description": "LinCenYing's ESLint config",
7
7
  "author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",