eslint-config-tungsten-flat 0.3.2 → 0.3.4
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.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +4 -3
- package/src/index.ts +101 -0
- package/src/modules.d.ts +2 -0
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,MAAM,EAAE,MAAM,eAAe,CAAA;;AAKnE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,MAAM,EAAE,MAAM,eAAe,CAAA;;AAKnE,wBA4FE"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,8 @@ export default defineConfig([
|
|
|
20
20
|
//'tungsten.config.js',
|
|
21
21
|
//'sxy-test-runner.config.js'
|
|
22
22
|
],
|
|
23
|
+
// how many config files to check - default 8
|
|
24
|
+
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 30,
|
|
23
25
|
},
|
|
24
26
|
//tsconfigRootDir: import.meta.dirname,
|
|
25
27
|
},
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-tungsten-flat",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
|
-
"dist"
|
|
7
|
+
"dist",
|
|
8
|
+
"src"
|
|
8
9
|
],
|
|
9
10
|
"main": "dist/index.js",
|
|
10
11
|
"keywords": [],
|
|
11
12
|
"author": "",
|
|
12
13
|
"license": "ISC",
|
|
13
14
|
"dependencies": {
|
|
14
|
-
"eslint-config-tungsten-base-flat": "^0.3.
|
|
15
|
+
"eslint-config-tungsten-base-flat": "^0.3.2",
|
|
15
16
|
"typescript-eslint": "^8.69.0"
|
|
16
17
|
},
|
|
17
18
|
"peerDependencies": {
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
|
|
2
|
+
import { defineConfig, globalIgnores, Config } from 'eslint/config'
|
|
3
|
+
//export type { CompatibleConfigArray } from 'typescript-eslint' // would use this instead of `as ConfigArray` if typescript-eslint exported this type
|
|
4
|
+
import tungstenBase from 'eslint-config-tungsten-base-flat'
|
|
5
|
+
import tseslint from 'typescript-eslint'
|
|
6
|
+
|
|
7
|
+
export default defineConfig([
|
|
8
|
+
{
|
|
9
|
+
extends: [tungstenBase]
|
|
10
|
+
},
|
|
11
|
+
//...tungstenJs,
|
|
12
|
+
///...tseslint.configs.recommended,
|
|
13
|
+
tseslint.configs.recommendedTypeChecked as Config[],
|
|
14
|
+
{
|
|
15
|
+
languageOptions: {
|
|
16
|
+
parserOptions: {
|
|
17
|
+
//projectService: true,
|
|
18
|
+
projectService: {
|
|
19
|
+
allowDefaultProject: [
|
|
20
|
+
'*.config.js',
|
|
21
|
+
//'eslint.config.js',
|
|
22
|
+
//'tungsten.config.js',
|
|
23
|
+
//'sxy-test-runner.config.js'
|
|
24
|
+
],
|
|
25
|
+
// how many config files to check - default 8
|
|
26
|
+
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 30,
|
|
27
|
+
},
|
|
28
|
+
//tsconfigRootDir: import.meta.dirname,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
//"plugin:@typescript-eslint/recommended",
|
|
34
|
+
//"plugin:import/typescript",
|
|
35
|
+
globalIgnores([".tungsten"]),
|
|
36
|
+
{
|
|
37
|
+
"rules": {
|
|
38
|
+
"prefer-const": "warn", // this is set in tungsten-base already, but for some reason gets reset to error
|
|
39
|
+
|
|
40
|
+
// //// style
|
|
41
|
+
// "no-trailing-spaces" : ["warn", {
|
|
42
|
+
// "skipBlankLines": true,
|
|
43
|
+
// "ignoreComments": true
|
|
44
|
+
// }],
|
|
45
|
+
|
|
46
|
+
// no import rules to disable - the base carries none, and this config
|
|
47
|
+
// deliberately does not take eslint-config-tungsten-js-flat
|
|
48
|
+
|
|
49
|
+
//"@typescript-eslint/ban-types": "warn", // removed
|
|
50
|
+
|
|
51
|
+
// which one to use? this had warn, but a project had it off
|
|
52
|
+
"@typescript-eslint/no-empty-object-type": "warn",
|
|
53
|
+
//"@typescript-eslint/no-empty-object-type": "off",
|
|
54
|
+
|
|
55
|
+
"@typescript-eslint/no-unsafe-function-type": "warn",
|
|
56
|
+
"@typescript-eslint/no-wrapper-object-types": "warn",
|
|
57
|
+
|
|
58
|
+
//"@typescript-eslint/no-empty-interface": "warn", // deprecated, superseded by no-empty-object-type above
|
|
59
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
60
|
+
"@typescript-eslint/no-namespace": "warn",
|
|
61
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
|
|
62
|
+
"@typescript-eslint/strict-boolean-expressions": "warn",
|
|
63
|
+
"@typescript-eslint/no-this-alias": "warn",
|
|
64
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
65
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
66
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
67
|
+
// would like to change to _unused or unused_, but conflicts with the camel case rule
|
|
68
|
+
//"@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "^__*$|^unused$|^unused|.+unused$", "argsIgnorePattern": "^__*$|^unused$|^unused_.+|.+_unused$|^reject$" }],
|
|
69
|
+
// "^_" (any leading underscore) subsumes the older "^__*$" (which only matched a
|
|
70
|
+
// name that was entirely underscores), and covers the `_name` convention too
|
|
71
|
+
"@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "^_|unused$", "argsIgnorePattern": "^_|unused$|^reject$" }],
|
|
72
|
+
"@typescript-eslint/switch-exhaustiveness-check": "warn",
|
|
73
|
+
"@typescript-eslint/require-await": "warn",
|
|
74
|
+
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
75
|
+
"@typescript-eslint/no-unsafe-call": "warn",
|
|
76
|
+
"@typescript-eslint/no-unused-expressions": "warn",
|
|
77
|
+
|
|
78
|
+
// added TS rules
|
|
79
|
+
'@typescript-eslint/no-misused-spread': 'warn',
|
|
80
|
+
|
|
81
|
+
// fires on every event handler and JSX prop taking an async function,
|
|
82
|
+
// which is the normal shape in a tungsten app
|
|
83
|
+
'@typescript-eslint/no-misused-promises': 'off',
|
|
84
|
+
'@typescript-eslint/no-for-in-array': 'off',
|
|
85
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
86
|
+
|
|
87
|
+
// these can give false positives due to eslint info being stale
|
|
88
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
89
|
+
|
|
90
|
+
// replaces the old plugin-no-type-assertion rule: permits widening, flags narrowing
|
|
91
|
+
"@typescript-eslint/no-unsafe-type-assertion": "warn",
|
|
92
|
+
|
|
93
|
+
// was using this in a project, but doesn't seem to change the underlying config
|
|
94
|
+
//"react/no-unknown-property": ["warn", { ignore: ["for"] }]
|
|
95
|
+
"react/no-unknown-property": "off"
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
])
|
|
100
|
+
|
|
101
|
+
|
package/src/modules.d.ts
ADDED