@so1ve/eslint-config 1.0.0-alpha.15 → 1.0.0-alpha.16

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
@@ -979,8 +979,7 @@ function warnUnnecessaryOffRules() {
979
979
  function typescript({
980
980
  componentExts = [],
981
981
  parserOptions,
982
- overrides,
983
- tsconfigPath
982
+ overrides
984
983
  } = {}) {
985
984
  const typeAwareRules = {
986
985
  "etc/no-assign-mutated-array": "error",
@@ -1033,12 +1032,7 @@ function typescript({
1033
1032
  parserOptions: {
1034
1033
  sourceType: "module",
1035
1034
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1036
- // Disable this because it doesn't work well with vue
1037
- // EXPERIMENTAL_useProjectService: true,
1038
- ...tsconfigPath ? {
1039
- project: [tsconfigPath],
1040
- tsconfigRootDir: process.cwd()
1041
- } : {},
1035
+ EXPERIMENTAL_useProjectService: true,
1042
1036
  // eslint-disable-next-line ts/no-unnecessary-type-assertion
1043
1037
  ...parserOptions
1044
1038
  }
@@ -1184,7 +1178,7 @@ function typescript({
1184
1178
  "ts/no-non-null-asserted-nullish-coalescing": "error",
1185
1179
  // handled by unused-imports/no-unused-imports
1186
1180
  "ts/no-unused-vars": "off",
1187
- ...tsconfigPath ? typeAwareRules : {},
1181
+ ...typeAwareRules,
1188
1182
  ...overrides
1189
1183
  }
1190
1184
  },
@@ -1501,11 +1495,11 @@ function so1ve(options = {}, ...userConfigs) {
1501
1495
  const {
1502
1496
  vue: enableVue = VuePackages.some((i) => localPkg.isPackageExists(i)),
1503
1497
  solid: enableSolid = localPkg.isPackageExists("solid-js"),
1498
+ typescript: enableTypeScript = localPkg.isPackageExists("typescript"),
1504
1499
  gitignore: enableGitignore = true,
1505
1500
  overrides = {},
1506
1501
  componentExts = []
1507
1502
  } = options;
1508
- let { typescript: enableTypeScript = localPkg.isPackageExists("typescript") } = options;
1509
1503
  const configs = [];
1510
1504
  if (enableGitignore) {
1511
1505
  if (typeof enableGitignore === "boolean") {
@@ -1533,16 +1527,10 @@ function so1ve(options = {}, ...userConfigs) {
1533
1527
  componentExts.push("vue");
1534
1528
  }
1535
1529
  if (enableTypeScript) {
1536
- if (typeof enableTypeScript !== "object") {
1537
- enableTypeScript = {
1538
- tsconfigPath: "tsconfig.json"
1539
- };
1540
- }
1541
1530
  configs.push(
1542
1531
  typescript({
1543
1532
  componentExts,
1544
- overrides: overrides.typescript,
1545
- ...enableTypeScript
1533
+ overrides: overrides.typescript
1546
1534
  })
1547
1535
  );
1548
1536
  }
package/dist/index.d.ts CHANGED
@@ -39,15 +39,9 @@ interface OptionsComponentExts {
39
39
  /** Additional extensions for components. */
40
40
  componentExts?: string[];
41
41
  }
42
- interface OptionsTypeScript {
42
+ interface OptionsTypeScriptParserOptions {
43
43
  /** Additional parser options for TypeScript. */
44
44
  parserOptions?: Partial<ParserOptions>;
45
- /**
46
- * Path to `tsconfig.json`.
47
- *
48
- * @default "tsconfig.json"
49
- */
50
- tsconfigPath?: string;
51
45
  }
52
46
  interface OptionsHasTypeScript {
53
47
  typescript?: boolean;
@@ -72,7 +66,7 @@ interface Options extends OptionsComponentExts {
72
66
  *
73
67
  * @default auto-detect based on the dependencies
74
68
  */
75
- typescript?: boolean | OptionsTypeScript;
69
+ typescript?: boolean;
76
70
  /**
77
71
  * Enable test support.
78
72
  *
@@ -180,7 +174,7 @@ declare const test: ({ overrides }?: OptionsOverrides) => ConfigItem[];
180
174
 
181
175
  declare const toml: ({ overrides }?: OptionsOverrides) => ConfigItem[];
182
176
 
183
- declare function typescript({ componentExts, parserOptions, overrides, tsconfigPath, }?: OptionsTypeScript & OptionsComponentExts & OptionsOverrides): ConfigItem[];
177
+ declare function typescript({ componentExts, parserOptions, overrides, }?: OptionsTypeScriptParserOptions & OptionsComponentExts & OptionsOverrides): ConfigItem[];
184
178
 
185
179
  declare const unicorn: () => ConfigItem[];
186
180
 
@@ -227,4 +221,4 @@ declare function recordRulesStateConfigs(configs: ConfigItem[]): ConfigItem[];
227
221
  declare function recordRulesState(rules: ConfigItem["rules"]): ConfigItem["rules"];
228
222
  declare function warnUnnecessaryOffRules(): void;
229
223
 
230
- export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, Options, OptionsComponentExts, OptionsHasTypeScript, OptionsOverrides, OptionsTypeScript, RenamedRules, combine, comments, formatting, html, ignores, imports, javascript, jsonc, mdx, node, onlyError, promise, recordRulesState, recordRulesStateConfigs, renameRules, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, warnUnnecessaryOffRules, yaml };
224
+ export { ConfigItem, GLOB_ALL_SRC, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, Options, OptionsComponentExts, OptionsHasTypeScript, OptionsOverrides, OptionsTypeScriptParserOptions, RenamedRules, combine, comments, formatting, html, ignores, imports, javascript, jsonc, mdx, node, onlyError, promise, recordRulesState, recordRulesStateConfigs, renameRules, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, warnUnnecessaryOffRules, yaml };
package/dist/index.mjs CHANGED
@@ -968,8 +968,7 @@ function warnUnnecessaryOffRules() {
968
968
  function typescript({
969
969
  componentExts = [],
970
970
  parserOptions,
971
- overrides,
972
- tsconfigPath
971
+ overrides
973
972
  } = {}) {
974
973
  const typeAwareRules = {
975
974
  "etc/no-assign-mutated-array": "error",
@@ -1022,12 +1021,7 @@ function typescript({
1022
1021
  parserOptions: {
1023
1022
  sourceType: "module",
1024
1023
  extraFileExtensions: componentExts.map((ext) => `.${ext}`),
1025
- // Disable this because it doesn't work well with vue
1026
- // EXPERIMENTAL_useProjectService: true,
1027
- ...tsconfigPath ? {
1028
- project: [tsconfigPath],
1029
- tsconfigRootDir: process.cwd()
1030
- } : {},
1024
+ EXPERIMENTAL_useProjectService: true,
1031
1025
  // eslint-disable-next-line ts/no-unnecessary-type-assertion
1032
1026
  ...parserOptions
1033
1027
  }
@@ -1173,7 +1167,7 @@ function typescript({
1173
1167
  "ts/no-non-null-asserted-nullish-coalescing": "error",
1174
1168
  // handled by unused-imports/no-unused-imports
1175
1169
  "ts/no-unused-vars": "off",
1176
- ...tsconfigPath ? typeAwareRules : {},
1170
+ ...typeAwareRules,
1177
1171
  ...overrides
1178
1172
  }
1179
1173
  },
@@ -1490,11 +1484,11 @@ function so1ve(options = {}, ...userConfigs) {
1490
1484
  const {
1491
1485
  vue: enableVue = VuePackages.some((i) => isPackageExists(i)),
1492
1486
  solid: enableSolid = isPackageExists("solid-js"),
1487
+ typescript: enableTypeScript = isPackageExists("typescript"),
1493
1488
  gitignore: enableGitignore = true,
1494
1489
  overrides = {},
1495
1490
  componentExts = []
1496
1491
  } = options;
1497
- let { typescript: enableTypeScript = isPackageExists("typescript") } = options;
1498
1492
  const configs = [];
1499
1493
  if (enableGitignore) {
1500
1494
  if (typeof enableGitignore === "boolean") {
@@ -1522,16 +1516,10 @@ function so1ve(options = {}, ...userConfigs) {
1522
1516
  componentExts.push("vue");
1523
1517
  }
1524
1518
  if (enableTypeScript) {
1525
- if (typeof enableTypeScript !== "object") {
1526
- enableTypeScript = {
1527
- tsconfigPath: "tsconfig.json"
1528
- };
1529
- }
1530
1519
  configs.push(
1531
1520
  typescript({
1532
1521
  componentExts,
1533
- overrides: overrides.typescript,
1534
- ...enableTypeScript
1522
+ overrides: overrides.typescript
1535
1523
  })
1536
1524
  );
1537
1525
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-config",
3
- "version": "1.0.0-alpha.15",
3
+ "version": "1.0.0-alpha.16",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
5
5
  "description": "Ray's eslint config.",
6
6
  "keywords": [
@@ -70,8 +70,8 @@
70
70
  "toml-eslint-parser": "^0.6.0",
71
71
  "vue-eslint-parser": "^9.3.1",
72
72
  "yaml-eslint-parser": "^1.2.2",
73
- "@so1ve/eslint-plugin": "1.0.0-alpha.15",
74
- "@so1ve/eslint-plugin-sort-imports": "1.0.0-alpha.15"
73
+ "@so1ve/eslint-plugin": "1.0.0-alpha.16",
74
+ "@so1ve/eslint-plugin-sort-imports": "1.0.0-alpha.16"
75
75
  },
76
76
  "devDependencies": {
77
77
  "eslint": "^8.46.0"