@mlaursen/eslint-config 8.0.0 → 8.0.1
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/base.js +17 -0
- package/dist/typescript.js +14 -12
- package/package.json +16 -16
package/dist/base.js
CHANGED
|
@@ -18,6 +18,7 @@ export var base = [
|
|
|
18
18
|
// You normally do not want `console.{whatever}` in prod but is fine for
|
|
19
19
|
// development in debugging
|
|
20
20
|
"no-console": DEV_WARNING_PROD_ERROR,
|
|
21
|
+
"no-var": "error",
|
|
21
22
|
"no-use-before-define": "warn",
|
|
22
23
|
// I want to enforce all statements to require curly braces even if it
|
|
23
24
|
// could be omitted for consistency
|
|
@@ -28,6 +29,22 @@ export var base = [
|
|
|
28
29
|
// This is about the same as `object-shorthand`. Only rename if it has to
|
|
29
30
|
// be renamed
|
|
30
31
|
"no-useless-rename": ["error"],
|
|
32
|
+
"no-eval": "error",
|
|
33
|
+
"no-alert": "error",
|
|
34
|
+
"no-lonely-if": "error",
|
|
35
|
+
"no-else-return": "error",
|
|
36
|
+
eqeqeq: "error",
|
|
37
|
+
// 100% stylistic, but do not allow `a = b = c = "whatever"` / `let a = whatever, b = whatever, c = whatever;`
|
|
38
|
+
// these should be different statements
|
|
39
|
+
"no-multi-assign": "error",
|
|
40
|
+
"no-sequences": "error",
|
|
41
|
+
// use template strings instead
|
|
42
|
+
"no-multi-str": "error",
|
|
43
|
+
// better to use new variables most of the time
|
|
44
|
+
"no-param-reassign": "error",
|
|
45
|
+
// i'd never hit these, but who trusts other people and AI?
|
|
46
|
+
"no-return-assign": "error",
|
|
47
|
+
"no-script-url": "error",
|
|
31
48
|
},
|
|
32
49
|
},
|
|
33
50
|
];
|
package/dist/typescript.js
CHANGED
|
@@ -26,15 +26,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
26
26
|
import tseslint from "typescript-eslint";
|
|
27
27
|
import { base } from "./base.js";
|
|
28
28
|
import { BASE_NAME, TEST_FILES, TS_FILES } from "./constants.js";
|
|
29
|
-
|
|
30
|
-
* @example
|
|
31
|
-
* ```ts
|
|
32
|
-
* import { config, configs, gitignore } from "@mlaursen/eslint-config";
|
|
33
|
-
*
|
|
34
|
-
* export default config(gitignore(import.meta.url), ...configs.typescript);
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export var typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base), false), __read(tseslint.configs.strict), false), [
|
|
29
|
+
var customTypescript = [
|
|
38
30
|
{
|
|
39
31
|
name: "".concat(BASE_NAME, "/typescript"),
|
|
40
32
|
files: TS_FILES,
|
|
@@ -89,7 +81,16 @@ export var typescript = __spreadArray(__spreadArray(__spreadArray([], __read(bas
|
|
|
89
81
|
"@typescript-eslint/no-var-requires": "off",
|
|
90
82
|
},
|
|
91
83
|
},
|
|
92
|
-
]
|
|
84
|
+
];
|
|
85
|
+
/**
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { config, configs, gitignore } from "@mlaursen/eslint-config";
|
|
89
|
+
*
|
|
90
|
+
* export default config(gitignore(import.meta.url), ...configs.typescript);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export var typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base), false), __read(tseslint.configs.strict), false), __read(customTypescript), false);
|
|
93
94
|
/**
|
|
94
95
|
* @example
|
|
95
96
|
* ```ts
|
|
@@ -102,7 +103,7 @@ export var typescript = __spreadArray(__spreadArray(__spreadArray([], __read(bas
|
|
|
102
103
|
* );
|
|
103
104
|
* ```
|
|
104
105
|
*/
|
|
105
|
-
export var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(__spreadArray(__spreadArray([], __read(typescript), false), __read(tseslint.configs.strictTypeCheckedOnly), false), [
|
|
106
|
+
export var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(typescript), false), __read(tseslint.configs.strictTypeCheckedOnly), false), [
|
|
106
107
|
{
|
|
107
108
|
name: "".concat(BASE_NAME, "/typescript-type-checking-language-options"),
|
|
108
109
|
languageOptions: {
|
|
@@ -111,7 +112,8 @@ export var typescriptTypeChecking = function (tsconfigRootDir) { return __spread
|
|
|
111
112
|
tsconfigRootDir: tsconfigRootDir,
|
|
112
113
|
},
|
|
113
114
|
},
|
|
114
|
-
}
|
|
115
|
+
}
|
|
116
|
+
], false), __read(customTypescript), false), [
|
|
115
117
|
{
|
|
116
118
|
name: "".concat(BASE_NAME, "/typescript-type-checking"),
|
|
117
119
|
files: TS_FILES,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlaursen/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.1",
|
|
5
5
|
"description": "An eslint config used by mlaursen for most projects.",
|
|
6
6
|
"repository": "https://github.com/mlaursen/eslint-config.git",
|
|
7
7
|
"author": "Mikkel Laursen <mlaursen03@gmail.com>",
|
|
@@ -21,31 +21,31 @@
|
|
|
21
21
|
"typescript"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@eslint/compat": "^1.2.
|
|
25
|
-
"@eslint/js": "^9.
|
|
24
|
+
"@eslint/compat": "^1.2.9",
|
|
25
|
+
"@eslint/js": "^9.28.0",
|
|
26
26
|
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
27
|
-
"@typescript-eslint/utils": "^8.
|
|
28
|
-
"@vitest/eslint-plugin": "^1.1
|
|
29
|
-
"eslint-plugin-jest": "^28.
|
|
27
|
+
"@typescript-eslint/utils": "^8.33.0",
|
|
28
|
+
"@vitest/eslint-plugin": "^1.2.1",
|
|
29
|
+
"eslint-plugin-jest": "^28.12.0",
|
|
30
30
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
31
31
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
32
32
|
"eslint-plugin-react": "^7.37.5",
|
|
33
33
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
34
|
-
"eslint-plugin-testing-library": "^7.
|
|
35
|
-
"typescript-eslint": "^8.
|
|
34
|
+
"eslint-plugin-testing-library": "^7.3.0",
|
|
35
|
+
"typescript-eslint": "^8.33.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@changesets/cli": "^2.29.
|
|
39
|
-
"@inquirer/prompts": "^7.
|
|
40
|
-
"@octokit/core": "^
|
|
41
|
-
"@types/node": "^22.
|
|
38
|
+
"@changesets/cli": "^2.29.4",
|
|
39
|
+
"@inquirer/prompts": "^7.5.3",
|
|
40
|
+
"@octokit/core": "^7.0.2",
|
|
41
|
+
"@types/node": "^22.15.29",
|
|
42
42
|
"dotenv": "^16.5.0",
|
|
43
|
-
"eslint": "^9.
|
|
43
|
+
"eslint": "^9.28.0",
|
|
44
44
|
"husky": "^9.1.7",
|
|
45
|
-
"inquirer": "^12.
|
|
46
|
-
"lint-staged": "^
|
|
45
|
+
"inquirer": "^12.6.3",
|
|
46
|
+
"lint-staged": "^16.1.0",
|
|
47
47
|
"prettier": "^3.5.3",
|
|
48
|
-
"tsx": "^4.19.
|
|
48
|
+
"tsx": "^4.19.4",
|
|
49
49
|
"typescript": "^5.8.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|