@jsse/eslint-config 0.1.22 → 0.2.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.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +103 -71
- package/dist/index.d.cts +127 -1097
- package/dist/index.d.ts +127 -1097
- package/dist/index.js +103 -71
- package/package.json +14 -14
package/dist/cli.cjs
CHANGED
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -10637,7 +10637,7 @@ function typescriptRulesTypeAware() {
|
|
|
10637
10637
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
10638
10638
|
"@typescript-eslint/no-unnecessary-type-arguments": "off",
|
|
10639
10639
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
10640
|
-
"@typescript-eslint/no-useless-template-literals": "error",
|
|
10640
|
+
// "@typescript-eslint/no-useless-template-literals": "error",
|
|
10641
10641
|
"no-throw-literal": "off",
|
|
10642
10642
|
"@typescript-eslint/only-throw-error": "error",
|
|
10643
10643
|
"@typescript-eslint/no-unsafe-argument": "error",
|
|
@@ -10780,56 +10780,61 @@ function typescriptRulesTypeOblivious() {
|
|
|
10780
10780
|
}
|
|
10781
10781
|
],
|
|
10782
10782
|
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
10783
|
-
"@typescript-eslint/ban-types": [
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
],
|
|
10783
|
+
// "@typescript-eslint/ban-types": [
|
|
10784
|
+
// "warn",
|
|
10785
|
+
// {
|
|
10786
|
+
// extendDefaults: false,
|
|
10787
|
+
// types: {
|
|
10788
|
+
// String: {
|
|
10789
|
+
// message: 'Use "string" instead',
|
|
10790
|
+
// fixWith: "string",
|
|
10791
|
+
// },
|
|
10792
|
+
// Boolean: {
|
|
10793
|
+
// message: 'Use "boolean" instead',
|
|
10794
|
+
// fixWith: "boolean",
|
|
10795
|
+
// },
|
|
10796
|
+
// Number: {
|
|
10797
|
+
// message: 'Use "number" instead',
|
|
10798
|
+
// fixWith: "number",
|
|
10799
|
+
// },
|
|
10800
|
+
// BigInt: {
|
|
10801
|
+
// message: "Use `bigint` instead.",
|
|
10802
|
+
// fixWith: "bigint",
|
|
10803
|
+
// },
|
|
10804
|
+
// Object: {
|
|
10805
|
+
// message:
|
|
10806
|
+
// "The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848",
|
|
10807
|
+
// fixWith: "Record<string, unknown>",
|
|
10808
|
+
// },
|
|
10809
|
+
// object: {
|
|
10810
|
+
// message:
|
|
10811
|
+
// "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
|
|
10812
|
+
// fixWith: "Record<string, unknown>",
|
|
10813
|
+
// },
|
|
10814
|
+
// Symbol: {
|
|
10815
|
+
// message: 'Use "symbol" instead',
|
|
10816
|
+
// fixWith: "symbol",
|
|
10817
|
+
// },
|
|
10818
|
+
// Function: {
|
|
10819
|
+
// message:
|
|
10820
|
+
// 'The "Function" type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with "new".\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.',
|
|
10821
|
+
// },
|
|
10822
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10823
|
+
// "{}": {
|
|
10824
|
+
// message:
|
|
10825
|
+
// "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
|
|
10826
|
+
// fixWith: "Record<string, unknown>",
|
|
10827
|
+
// },
|
|
10828
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10829
|
+
// "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
|
|
10830
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10831
|
+
// "[[]]":
|
|
10832
|
+
// "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
|
|
10833
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10834
|
+
// "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead.",
|
|
10835
|
+
// },
|
|
10836
|
+
// },
|
|
10837
|
+
// ],
|
|
10833
10838
|
"@typescript-eslint/consistent-type-assertions": "error",
|
|
10834
10839
|
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
10835
10840
|
"@typescript-eslint/member-ordering": [
|
|
@@ -10979,29 +10984,28 @@ function typescriptRulesTypeOblivious() {
|
|
|
10979
10984
|
],
|
|
10980
10985
|
"default-param-last": "off",
|
|
10981
10986
|
"@typescript-eslint/default-param-last": "error",
|
|
10982
|
-
"func-call-spacing": "off",
|
|
10987
|
+
// "func-call-spacing": "off",
|
|
10983
10988
|
"@typescript-eslint/func-call-spacing": ["error", "never"],
|
|
10984
|
-
"keyword-spacing": "off",
|
|
10989
|
+
// "keyword-spacing": "off",
|
|
10985
10990
|
"@typescript-eslint/keyword-spacing": "error",
|
|
10986
|
-
"lines-between-class-members": "off",
|
|
10987
|
-
"@typescript-eslint/lines-between-class-members": [
|
|
10988
|
-
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
],
|
|
10991
|
+
// "lines-between-class-members": "off",
|
|
10992
|
+
// "@typescript-eslint/lines-between-class-members": [
|
|
10993
|
+
// "error",
|
|
10994
|
+
// "always",
|
|
10995
|
+
// {
|
|
10996
|
+
// exceptAfterSingleLine: true,
|
|
10997
|
+
// },
|
|
10998
|
+
// ],
|
|
10994
10999
|
"no-dupe-class-members": "off",
|
|
10995
11000
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
10996
11001
|
"no-empty-function": "off",
|
|
10997
11002
|
"@typescript-eslint/no-empty-function": "error",
|
|
10998
|
-
"no-extra-parens": "off",
|
|
10999
|
-
"no-extra-semi": "off",
|
|
11003
|
+
// "no-extra-parens": "off",
|
|
11004
|
+
// "no-extra-semi": "off",
|
|
11000
11005
|
"@typescript-eslint/no-extra-semi": "error",
|
|
11001
11006
|
"no-loop-func": "off",
|
|
11002
11007
|
"@typescript-eslint/no-loop-func": "error",
|
|
11003
11008
|
"no-loss-of-precision": "off",
|
|
11004
|
-
"@typescript-eslint/no-loss-of-precision": "error",
|
|
11005
11009
|
"no-redeclare": "off",
|
|
11006
11010
|
"@typescript-eslint/no-redeclare": "error",
|
|
11007
11011
|
"no-restricted-imports": "off",
|
|
@@ -11020,17 +11024,17 @@ function typescriptRulesTypeOblivious() {
|
|
|
11020
11024
|
]
|
|
11021
11025
|
}
|
|
11022
11026
|
],
|
|
11023
|
-
"padding-line-between-statements": "off",
|
|
11027
|
+
// "padding-line-between-statements": "off",
|
|
11024
11028
|
"@typescript-eslint/padding-line-between-statements": "off",
|
|
11025
|
-
quotes: "off",
|
|
11029
|
+
// quotes: "off",
|
|
11026
11030
|
"@typescript-eslint/quotes": "off",
|
|
11027
|
-
"space-before-function-paren": "off",
|
|
11031
|
+
// "space-before-function-paren": "off",
|
|
11028
11032
|
"@typescript-eslint/space-before-function-paren": "off",
|
|
11029
|
-
"space-infix-ops": "off",
|
|
11033
|
+
// "space-infix-ops": "off",
|
|
11030
11034
|
"@typescript-eslint/space-infix-ops": "error",
|
|
11031
|
-
semi: "off",
|
|
11035
|
+
// semi: "off",
|
|
11032
11036
|
"@typescript-eslint/semi": ["error", "always"],
|
|
11033
|
-
"space-before-blocks": "off",
|
|
11037
|
+
// "space-before-blocks": "off",
|
|
11034
11038
|
"@typescript-eslint/space-before-blocks": ["error", "always"],
|
|
11035
11039
|
"no-undef": "off",
|
|
11036
11040
|
"no-duplicate-imports": "off",
|
|
@@ -11332,7 +11336,16 @@ function typescriptLanguageOptions(options) {
|
|
|
11332
11336
|
tsconfig
|
|
11333
11337
|
} = options || {};
|
|
11334
11338
|
const tsOptions = tsconfig ? {
|
|
11335
|
-
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
11339
|
+
// project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
11340
|
+
projectService: {
|
|
11341
|
+
allowDefaultProject: [
|
|
11342
|
+
"*.js",
|
|
11343
|
+
"tsconfig.json",
|
|
11344
|
+
"*.ts",
|
|
11345
|
+
"scripts/*.ts"
|
|
11346
|
+
],
|
|
11347
|
+
defaultProject: tsconfig
|
|
11348
|
+
},
|
|
11336
11349
|
tsconfigRootDir: import_node_process4.default.cwd()
|
|
11337
11350
|
} : {};
|
|
11338
11351
|
const parserOptions = {
|
|
@@ -11963,6 +11976,7 @@ var typescript = async (options) => {
|
|
|
11963
11976
|
// only apply ts rules to ts files!
|
|
11964
11977
|
files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
11965
11978
|
name: "jsse/typescript/rules",
|
|
11979
|
+
// may not need to rename all rules here........
|
|
11966
11980
|
rules: renameRules(tsrules || {}, tsPrefix, tsPrefixTo)
|
|
11967
11981
|
},
|
|
11968
11982
|
{
|
|
@@ -12461,6 +12475,24 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12461
12475
|
return res;
|
|
12462
12476
|
}
|
|
12463
12477
|
}
|
|
12478
|
+
for (const config of combinedConfigs) {
|
|
12479
|
+
if (config.plugins) {
|
|
12480
|
+
for (const [key, value] of Object.entries(config.plugins)) {
|
|
12481
|
+
if (key.startsWith("@typescript-eslint/")) {
|
|
12482
|
+
delete config.plugins[key];
|
|
12483
|
+
config.plugins[`${tsPrefix}/${key.slice("@typescript-eslint/".length)}`] = value;
|
|
12484
|
+
}
|
|
12485
|
+
}
|
|
12486
|
+
}
|
|
12487
|
+
if (config.rules) {
|
|
12488
|
+
for (const [key, value] of Object.entries(config.rules)) {
|
|
12489
|
+
if (key.startsWith("@typescript-eslint/")) {
|
|
12490
|
+
delete config.rules[key];
|
|
12491
|
+
config.rules[`${tsPrefix}/${key.slice("@typescript-eslint/".length)}`] = value;
|
|
12492
|
+
}
|
|
12493
|
+
}
|
|
12494
|
+
}
|
|
12495
|
+
}
|
|
12464
12496
|
return combinedConfigs;
|
|
12465
12497
|
}
|
|
12466
12498
|
|