@dhzh/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/cli/index.cjs +2 -3
- package/dist/cli/index.js +2 -3
- package/dist/index.cjs +9 -4
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -4
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -28,7 +28,7 @@ var import_ansis5 = __toESM(require("ansis"), 1);
|
|
|
28
28
|
var import_cac = require("cac");
|
|
29
29
|
|
|
30
30
|
// package.json
|
|
31
|
-
var version = "1.
|
|
31
|
+
var version = "1.4.0";
|
|
32
32
|
var package_default = {
|
|
33
33
|
name: "@dhzh/eslint-config",
|
|
34
34
|
type: "module",
|
|
@@ -277,8 +277,7 @@ var vscodeSettingsString = `
|
|
|
277
277
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
278
278
|
}
|
|
279
279
|
`;
|
|
280
|
-
var eslintConfigContent = `
|
|
281
|
-
import { defineConfig } from '@dhzh/eslint-config';
|
|
280
|
+
var eslintConfigContent = `import { defineConfig } from '@dhzh/eslint-config';
|
|
282
281
|
|
|
283
282
|
export default defineConfig();
|
|
284
283
|
`;
|
package/dist/cli/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import c4 from "ansis";
|
|
|
4
4
|
import { cac } from "cac";
|
|
5
5
|
|
|
6
6
|
// package.json
|
|
7
|
-
var version = "1.
|
|
7
|
+
var version = "1.4.0";
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "@dhzh/eslint-config",
|
|
10
10
|
type: "module",
|
|
@@ -253,8 +253,7 @@ var vscodeSettingsString = `
|
|
|
253
253
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
254
254
|
}
|
|
255
255
|
`;
|
|
256
|
-
var eslintConfigContent = `
|
|
257
|
-
import { defineConfig } from '@dhzh/eslint-config';
|
|
256
|
+
var eslintConfigContent = `import { defineConfig } from '@dhzh/eslint-config';
|
|
258
257
|
|
|
259
258
|
export default defineConfig();
|
|
260
259
|
`;
|
package/dist/index.cjs
CHANGED
|
@@ -524,7 +524,7 @@ function stylistic(options = {}) {
|
|
|
524
524
|
var import_node_process = __toESM(require("process"), 1);
|
|
525
525
|
var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
526
526
|
function typescript(options = {}) {
|
|
527
|
-
const { overrides = {} } = options;
|
|
527
|
+
const { overrides = {}, typeSafe = false } = options;
|
|
528
528
|
return [
|
|
529
529
|
...import_typescript_eslint.default.config(
|
|
530
530
|
import_typescript_eslint.default.configs.base,
|
|
@@ -573,9 +573,6 @@ function typescript(options = {}) {
|
|
|
573
573
|
],
|
|
574
574
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
575
575
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
576
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
577
|
-
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
578
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
|
579
576
|
"@typescript-eslint/no-explicit-any": "off",
|
|
580
577
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
|
|
581
578
|
"@typescript-eslint/await-thenable": "error",
|
|
@@ -601,6 +598,12 @@ function typescript(options = {}) {
|
|
|
601
598
|
}
|
|
602
599
|
],
|
|
603
600
|
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
601
|
+
...typeSafe ? {} : {
|
|
602
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
603
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
604
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
605
|
+
"@typescript-eslint/no-unsafe-return": "off"
|
|
606
|
+
},
|
|
604
607
|
...overrides
|
|
605
608
|
}
|
|
606
609
|
}
|
|
@@ -990,6 +993,7 @@ function json(options = {}) {
|
|
|
990
993
|
"jsonc/comma-dangle": ["error", "never"],
|
|
991
994
|
"jsonc/comma-style": ["error", "last"],
|
|
992
995
|
"jsonc/indent": ["error", indent],
|
|
996
|
+
"jsonc/no-comments": "off",
|
|
993
997
|
"jsonc/key-spacing": [
|
|
994
998
|
"error",
|
|
995
999
|
{
|
|
@@ -1144,6 +1148,7 @@ function unicorn(options = {}) {
|
|
|
1144
1148
|
"unicorn/prefer-dom-node-text-content": "error",
|
|
1145
1149
|
"unicorn/prefer-includes": "error",
|
|
1146
1150
|
"unicorn/prefer-node-protocol": "error",
|
|
1151
|
+
"unicorn/prefer-query-selector": "off",
|
|
1147
1152
|
"unicorn/prefer-number-properties": "error",
|
|
1148
1153
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1149
1154
|
"unicorn/prefer-type-error": "error",
|
package/dist/index.d.cts
CHANGED
|
@@ -132,6 +132,7 @@ interface IReactConfigsOptions {
|
|
|
132
132
|
interface IStylisticConfigsOptions extends IConfigsOptions {
|
|
133
133
|
}
|
|
134
134
|
interface ITypescriptConfigsOptions extends IConfigsOptions {
|
|
135
|
+
typeSafe?: boolean;
|
|
135
136
|
}
|
|
136
137
|
interface IJavascriptConfigsOptions extends IConfigsOptions {
|
|
137
138
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -132,6 +132,7 @@ interface IReactConfigsOptions {
|
|
|
132
132
|
interface IStylisticConfigsOptions extends IConfigsOptions {
|
|
133
133
|
}
|
|
134
134
|
interface ITypescriptConfigsOptions extends IConfigsOptions {
|
|
135
|
+
typeSafe?: boolean;
|
|
135
136
|
}
|
|
136
137
|
interface IJavascriptConfigsOptions extends IConfigsOptions {
|
|
137
138
|
}
|
package/dist/index.js
CHANGED
|
@@ -488,7 +488,7 @@ function stylistic(options = {}) {
|
|
|
488
488
|
import process from "node:process";
|
|
489
489
|
import tseslint from "typescript-eslint";
|
|
490
490
|
function typescript(options = {}) {
|
|
491
|
-
const { overrides = {} } = options;
|
|
491
|
+
const { overrides = {}, typeSafe = false } = options;
|
|
492
492
|
return [
|
|
493
493
|
...tseslint.config(
|
|
494
494
|
tseslint.configs.base,
|
|
@@ -537,9 +537,6 @@ function typescript(options = {}) {
|
|
|
537
537
|
],
|
|
538
538
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
539
539
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
540
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
541
|
-
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
542
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
|
543
540
|
"@typescript-eslint/no-explicit-any": "off",
|
|
544
541
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
|
|
545
542
|
"@typescript-eslint/await-thenable": "error",
|
|
@@ -565,6 +562,12 @@ function typescript(options = {}) {
|
|
|
565
562
|
}
|
|
566
563
|
],
|
|
567
564
|
"@typescript-eslint/prefer-nullish-coalescing": "off",
|
|
565
|
+
...typeSafe ? {} : {
|
|
566
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
567
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
568
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
569
|
+
"@typescript-eslint/no-unsafe-return": "off"
|
|
570
|
+
},
|
|
568
571
|
...overrides
|
|
569
572
|
}
|
|
570
573
|
}
|
|
@@ -954,6 +957,7 @@ function json(options = {}) {
|
|
|
954
957
|
"jsonc/comma-dangle": ["error", "never"],
|
|
955
958
|
"jsonc/comma-style": ["error", "last"],
|
|
956
959
|
"jsonc/indent": ["error", indent],
|
|
960
|
+
"jsonc/no-comments": "off",
|
|
957
961
|
"jsonc/key-spacing": [
|
|
958
962
|
"error",
|
|
959
963
|
{
|
|
@@ -1108,6 +1112,7 @@ function unicorn(options = {}) {
|
|
|
1108
1112
|
"unicorn/prefer-dom-node-text-content": "error",
|
|
1109
1113
|
"unicorn/prefer-includes": "error",
|
|
1110
1114
|
"unicorn/prefer-node-protocol": "error",
|
|
1115
|
+
"unicorn/prefer-query-selector": "off",
|
|
1111
1116
|
"unicorn/prefer-number-properties": "error",
|
|
1112
1117
|
"unicorn/prefer-string-starts-ends-with": "error",
|
|
1113
1118
|
"unicorn/prefer-type-error": "error",
|