@mlaursen/eslint-config 6.1.0 → 7.0.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/base.js +6 -12
- package/dist/constants.js +5 -8
- package/dist/frontend.js +7 -11
- package/dist/gitignore.js +8 -14
- package/dist/index.d.ts +3 -2
- package/dist/index.js +29 -32
- package/dist/jest.js +7 -13
- package/dist/jsxA11y.js +6 -12
- package/dist/next.js +7 -13
- package/dist/react.js +9 -15
- package/dist/testing-library.js +9 -15
- package/dist/typescript.js +14 -21
- package/package.json +5 -3
package/dist/base.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.base = void 0;
|
|
7
|
-
var js_1 = __importDefault(require("@eslint/js"));
|
|
8
|
-
var constants_1 = require("./constants");
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import { BASE_NAME, DEV_WARNING_PROD_ERROR } from "./constants.js";
|
|
9
3
|
/**
|
|
10
4
|
* @example
|
|
11
5
|
* ```js
|
|
@@ -14,16 +8,16 @@ var constants_1 = require("./constants");
|
|
|
14
8
|
* export default configs.base;
|
|
15
9
|
* ```
|
|
16
10
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
export var base = [
|
|
12
|
+
eslint.configs.recommended,
|
|
19
13
|
{
|
|
20
|
-
name: "".concat(
|
|
14
|
+
name: "".concat(BASE_NAME, "/base"),
|
|
21
15
|
rules: {
|
|
22
16
|
// I use typescript instead
|
|
23
17
|
"no-undef": "off",
|
|
24
18
|
// You normally do not want `console.{whatever}` in prod but is fine for
|
|
25
19
|
// development in debugging
|
|
26
|
-
"no-console":
|
|
20
|
+
"no-console": DEV_WARNING_PROD_ERROR,
|
|
27
21
|
"no-use-before-define": "warn",
|
|
28
22
|
// I want to enforce all statements to require curly braces even if it
|
|
29
23
|
// could be omitted for consistency
|
package/dist/constants.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.BASE_NAME = "@mlaursen/eslint-config";
|
|
6
|
-
exports.TS_FILES = ["**/*.{ts,tsx,mts,mtsx}"];
|
|
7
|
-
exports.TEST_FILES = [
|
|
1
|
+
export var DEV_WARNING_PROD_ERROR = process.env.NODE_ENV !== "production" ? "warn" : "error";
|
|
2
|
+
export var BASE_NAME = "@mlaursen/eslint-config";
|
|
3
|
+
export var TS_FILES = ["**/*.{ts,tsx,mts,mtsx}"];
|
|
4
|
+
export var TEST_FILES = [
|
|
8
5
|
"**/__tests__/**",
|
|
9
6
|
"**/*.{spec,test}.{ts,tsx,js,jsx}",
|
|
10
7
|
];
|
|
11
|
-
|
|
8
|
+
export var JSX_FILES = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"];
|
package/dist/frontend.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __read = (this && this.__read) || function (o, n) {
|
|
3
2
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
3
|
if (!m) return o;
|
|
@@ -24,13 +23,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
24
23
|
}
|
|
25
24
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
25
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var testing_library_1 = require("./testing-library");
|
|
33
|
-
var typescript_1 = require("./typescript");
|
|
26
|
+
import { jest, jestDom } from "./jest.js";
|
|
27
|
+
import { jsxA11y } from "./jsxA11y.js";
|
|
28
|
+
import { react } from "./react.js";
|
|
29
|
+
import { testingLibraryReact } from "./testing-library.js";
|
|
30
|
+
import { typescript, typescriptTypeChecking } from "./typescript.js";
|
|
34
31
|
/**
|
|
35
32
|
* @example
|
|
36
33
|
* ```ts
|
|
@@ -42,7 +39,7 @@ var typescript_1 = require("./typescript");
|
|
|
42
39
|
* );
|
|
43
40
|
* ```
|
|
44
41
|
*/
|
|
45
|
-
|
|
42
|
+
export var frontend = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(typescript), false), __read(react), false), __read(jsxA11y), false), __read(jest), false), __read(jestDom), false), __read(testingLibraryReact), false);
|
|
46
43
|
/**
|
|
47
44
|
* @example
|
|
48
45
|
* ```ts
|
|
@@ -54,5 +51,4 @@ exports.frontend = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spr
|
|
|
54
51
|
* );
|
|
55
52
|
* ```
|
|
56
53
|
*/
|
|
57
|
-
var frontendTypeChecking = function (tsconfigRootDir) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(
|
|
58
|
-
exports.frontendTypeChecking = frontendTypeChecking;
|
|
54
|
+
export var frontendTypeChecking = function (tsconfigRootDir) { return __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(typescriptTypeChecking(tsconfigRootDir)), false), __read(react), false), __read(jsxA11y), false), __read(jest), false), __read(jestDom), false), __read(testingLibraryReact), false); };
|
package/dist/gitignore.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.gitignore = gitignore;
|
|
7
|
-
var compat_1 = require("@eslint/compat");
|
|
8
|
-
var node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
var node_url_1 = require("node:url");
|
|
1
|
+
import { includeIgnoreFile } from "@eslint/compat";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
10
4
|
/**
|
|
11
5
|
* @example
|
|
12
6
|
* ```ts
|
|
@@ -23,9 +17,9 @@ var node_url_1 = require("node:url");
|
|
|
23
17
|
* export default config(gitignore(join(import.meta.url, "..", "..")), ...configs.typescript);
|
|
24
18
|
* ```
|
|
25
19
|
*/
|
|
26
|
-
function gitignore(importMetaUrl) {
|
|
27
|
-
var __filename =
|
|
28
|
-
var __dirname =
|
|
29
|
-
var gitignorePath =
|
|
30
|
-
return
|
|
20
|
+
export function gitignore(importMetaUrl) {
|
|
21
|
+
var __filename = fileURLToPath(importMetaUrl);
|
|
22
|
+
var __dirname = path.dirname(__filename);
|
|
23
|
+
var gitignorePath = path.resolve(__dirname, ".gitignore");
|
|
24
|
+
return includeIgnoreFile(gitignorePath);
|
|
31
25
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { config } from "typescript-eslint";
|
|
2
|
-
import { gitignore } from "./gitignore";
|
|
2
|
+
import { gitignore } from "./gitignore.js";
|
|
3
|
+
export * from "./constants.js";
|
|
4
|
+
export { config, gitignore };
|
|
3
5
|
export declare const configs: {
|
|
4
6
|
readonly base: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
5
7
|
readonly jest: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
@@ -14,7 +16,6 @@ export declare const configs: {
|
|
|
14
16
|
readonly jsxA11y: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
15
17
|
readonly next: import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray;
|
|
16
18
|
};
|
|
17
|
-
export { config, gitignore };
|
|
18
19
|
declare const _default: {
|
|
19
20
|
config: typeof config;
|
|
20
21
|
configs: {
|
package/dist/index.js
CHANGED
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
frontendTypeChecking: frontend_1.frontendTypeChecking,
|
|
27
|
-
jsxA11y: jsxA11y_1.jsxA11y,
|
|
28
|
-
next: next_1.next,
|
|
1
|
+
import { config } from "typescript-eslint";
|
|
2
|
+
import { base } from "./base.js";
|
|
3
|
+
import { frontend, frontendTypeChecking } from "./frontend.js";
|
|
4
|
+
import { gitignore } from "./gitignore.js";
|
|
5
|
+
import { jest, jestDom } from "./jest.js";
|
|
6
|
+
import { jsxA11y } from "./jsxA11y.js";
|
|
7
|
+
import { next } from "./next.js";
|
|
8
|
+
import { react } from "./react.js";
|
|
9
|
+
import { testingLibraryDom, testingLibraryReact } from "./testing-library.js";
|
|
10
|
+
import { typescript, typescriptTypeChecking } from "./typescript.js";
|
|
11
|
+
export * from "./constants.js";
|
|
12
|
+
export { config, gitignore };
|
|
13
|
+
export var configs = {
|
|
14
|
+
base: base,
|
|
15
|
+
jest: jest,
|
|
16
|
+
jestDom: jestDom,
|
|
17
|
+
react: react,
|
|
18
|
+
typescript: typescript,
|
|
19
|
+
typescriptTypeChecking: typescriptTypeChecking,
|
|
20
|
+
testingLibraryDom: testingLibraryDom,
|
|
21
|
+
testingLibraryReact: testingLibraryReact,
|
|
22
|
+
frontend: frontend,
|
|
23
|
+
frontendTypeChecking: frontendTypeChecking,
|
|
24
|
+
jsxA11y: jsxA11y,
|
|
25
|
+
next: next,
|
|
29
26
|
};
|
|
30
|
-
|
|
31
|
-
config:
|
|
32
|
-
configs:
|
|
33
|
-
gitignore:
|
|
27
|
+
export default {
|
|
28
|
+
config: config,
|
|
29
|
+
configs: configs,
|
|
30
|
+
gitignore: gitignore,
|
|
34
31
|
};
|
package/dist/jest.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,14 +9,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.jestDom = exports.jest = void 0;
|
|
18
|
-
var eslint_plugin_jest_1 = __importDefault(require("eslint-plugin-jest"));
|
|
19
|
-
var eslint_plugin_jest_dom_1 = __importDefault(require("eslint-plugin-jest-dom"));
|
|
20
|
-
var constants_1 = require("./constants");
|
|
12
|
+
import jestPlugin from "eslint-plugin-jest";
|
|
13
|
+
import jestDomPlugin from "eslint-plugin-jest-dom";
|
|
14
|
+
import { BASE_NAME, TEST_FILES } from "./constants.js";
|
|
21
15
|
/**
|
|
22
16
|
* @example
|
|
23
17
|
* ```ts
|
|
@@ -26,8 +20,8 @@ var constants_1 = require("./constants");
|
|
|
26
20
|
* export default config(...configs.jest);
|
|
27
21
|
* ```
|
|
28
22
|
*/
|
|
29
|
-
|
|
30
|
-
__assign({ name: "".concat(
|
|
23
|
+
export var jest = [
|
|
24
|
+
__assign({ name: "".concat(BASE_NAME, "/jest"), files: TEST_FILES }, jestPlugin.configs["flat/recommended"]),
|
|
31
25
|
];
|
|
32
26
|
/**
|
|
33
27
|
* @example
|
|
@@ -37,6 +31,6 @@ exports.jest = [
|
|
|
37
31
|
* export default config(...configs.jest, ...configs.jestDom);
|
|
38
32
|
* ```
|
|
39
33
|
*/
|
|
40
|
-
|
|
41
|
-
__assign({ name: "".concat(
|
|
34
|
+
export var jestDom = [
|
|
35
|
+
__assign({ name: "".concat(BASE_NAME, "/jest-dom"), files: TEST_FILES }, jestDomPlugin.configs["flat/recommended"]),
|
|
42
36
|
];
|
package/dist/jsxA11y.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,13 +9,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.jsxA11y = void 0;
|
|
18
|
-
var eslint_plugin_jsx_a11y_1 = __importDefault(require("eslint-plugin-jsx-a11y"));
|
|
19
|
-
var constants_1 = require("./constants");
|
|
12
|
+
import jsxA11yPlugin from "eslint-plugin-jsx-a11y";
|
|
13
|
+
import { BASE_NAME, JSX_FILES, TEST_FILES } from "./constants.js";
|
|
20
14
|
/**
|
|
21
15
|
* @example
|
|
22
16
|
* ```ts
|
|
@@ -25,15 +19,15 @@ var constants_1 = require("./constants");
|
|
|
25
19
|
* export default config(...configs.jsxA11y);
|
|
26
20
|
* ```
|
|
27
21
|
*/
|
|
28
|
-
|
|
29
|
-
__assign(__assign({ name: "".concat(
|
|
22
|
+
export var jsxA11y = [
|
|
23
|
+
__assign(__assign({ name: "".concat(BASE_NAME, "/jsx-a11y"), files: JSX_FILES }, jsxA11yPlugin.flatConfigs.recommended), { rules: {
|
|
30
24
|
// I **only** use autoFocus within dialogs which provide the correct
|
|
31
25
|
// context for screen readers.
|
|
32
26
|
"jsx-a11y/no-autofocus": "off",
|
|
33
27
|
} }),
|
|
34
28
|
{
|
|
35
|
-
name: "".concat(
|
|
36
|
-
files:
|
|
29
|
+
name: "".concat(BASE_NAME, "/jsx-a11y/testing"),
|
|
30
|
+
files: TEST_FILES,
|
|
37
31
|
rules: {
|
|
38
32
|
"jsx-a11y/anchor-has-content": "off",
|
|
39
33
|
"jsx-a11y/click-events-have-key-events": "off",
|
package/dist/next.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,14 +9,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.next = void 0;
|
|
18
|
-
var compat_1 = require("@eslint/compat");
|
|
19
|
-
var eslint_plugin_next_1 = __importDefault(require("@next/eslint-plugin-next"));
|
|
20
|
-
var constants_1 = require("./constants");
|
|
12
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
13
|
+
import nextPlugin from "@next/eslint-plugin-next";
|
|
14
|
+
import { BASE_NAME } from "./constants.js";
|
|
21
15
|
/**
|
|
22
16
|
* @example
|
|
23
17
|
* ```ts
|
|
@@ -26,13 +20,13 @@ var constants_1 = require("./constants");
|
|
|
26
20
|
* export default config(gitignore(import.meta.url), ...configs.typescript, ...configs.next);
|
|
27
21
|
* ```
|
|
28
22
|
*/
|
|
29
|
-
|
|
23
|
+
export var next = [
|
|
30
24
|
{
|
|
31
|
-
name: "".concat(
|
|
25
|
+
name: "".concat(BASE_NAME, "/next"),
|
|
32
26
|
plugins: {
|
|
33
27
|
// @ts-expect-error There is a bad typing atm
|
|
34
|
-
"@next/next":
|
|
28
|
+
"@next/next": fixupPluginRules(nextPlugin),
|
|
35
29
|
},
|
|
36
|
-
rules: __assign({},
|
|
30
|
+
rules: __assign({}, nextPlugin.configs.recommended.rules),
|
|
37
31
|
},
|
|
38
32
|
];
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,16 +9,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.react = void 0;
|
|
18
|
-
var eslint_plugin_react_1 = __importDefault(require("eslint-plugin-react"));
|
|
19
|
-
var eslint_plugin_react_hooks_1 = __importDefault(require("eslint-plugin-react-hooks"));
|
|
20
|
-
var constants_1 = require("./constants");
|
|
12
|
+
import reactPlugin from "eslint-plugin-react";
|
|
13
|
+
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
14
|
+
import { BASE_NAME, JSX_FILES } from "./constants.js";
|
|
21
15
|
// Why is the typedef optional?
|
|
22
|
-
var flat =
|
|
16
|
+
var flat = reactPlugin.configs.flat;
|
|
23
17
|
var reactPlugins = flat.recommended.plugins;
|
|
24
18
|
var recommendedRules = flat.recommended.rules;
|
|
25
19
|
var jsxRuntimeRules = flat["jsx-runtime"].rules;
|
|
@@ -38,17 +32,17 @@ var jsxRuntimeRules = flat["jsx-runtime"].rules;
|
|
|
38
32
|
* - `eslint-plugin-react-hooks` with:
|
|
39
33
|
* - recommended rules
|
|
40
34
|
*/
|
|
41
|
-
|
|
35
|
+
export var react = [
|
|
42
36
|
{
|
|
43
|
-
name: "".concat(
|
|
44
|
-
files:
|
|
37
|
+
name: "".concat(BASE_NAME, "/react"),
|
|
38
|
+
files: JSX_FILES,
|
|
45
39
|
settings: {
|
|
46
40
|
react: {
|
|
47
41
|
version: "detect",
|
|
48
42
|
},
|
|
49
43
|
},
|
|
50
|
-
plugins: __assign(__assign({}, reactPlugins), { "react-hooks":
|
|
51
|
-
rules: __assign(__assign(__assign(__assign({}, recommendedRules), jsxRuntimeRules),
|
|
44
|
+
plugins: __assign(__assign({}, reactPlugins), { "react-hooks": reactHooksPlugin }),
|
|
45
|
+
rules: __assign(__assign(__assign(__assign({}, recommendedRules), jsxRuntimeRules), reactHooksPlugin.configs.recommended.rules), { "react-hooks/exhaustive-deps": [
|
|
52
46
|
"error",
|
|
53
47
|
{
|
|
54
48
|
additionalHooks: "(useIsomorphicLayoutEffect)",
|
package/dist/testing-library.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __assign = (this && this.__assign) || function () {
|
|
3
2
|
__assign = Object.assign || function(t) {
|
|
4
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,19 +9,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
9
|
};
|
|
11
10
|
return __assign.apply(this, arguments);
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.testingLibraryDom = exports.testingLibraryReact = void 0;
|
|
18
|
-
var compat_1 = require("@eslint/compat");
|
|
19
|
-
var eslint_plugin_testing_library_1 = __importDefault(require("eslint-plugin-testing-library"));
|
|
20
|
-
var constants_1 = require("./constants");
|
|
12
|
+
import { fixupPluginRules } from "@eslint/compat";
|
|
13
|
+
import testingLibraryPlugin from "eslint-plugin-testing-library";
|
|
14
|
+
import { BASE_NAME, TEST_FILES } from "./constants.js";
|
|
21
15
|
var testingLibrary = {
|
|
22
|
-
files:
|
|
16
|
+
files: TEST_FILES,
|
|
23
17
|
plugins: {
|
|
24
18
|
// @ts-expect-error There is a bad typing atm
|
|
25
|
-
"testing-library":
|
|
19
|
+
"testing-library": fixupPluginRules(testingLibraryPlugin),
|
|
26
20
|
},
|
|
27
21
|
};
|
|
28
22
|
/**
|
|
@@ -41,8 +35,8 @@ var testingLibrary = {
|
|
|
41
35
|
* NOTE: Only choose this or the {@link testingLibraryDom}. Do not use
|
|
42
36
|
* both.
|
|
43
37
|
*/
|
|
44
|
-
|
|
45
|
-
__assign(__assign({}, testingLibrary), { name: "".concat(
|
|
38
|
+
export var testingLibraryReact = [
|
|
39
|
+
__assign(__assign({}, testingLibrary), { name: "".concat(BASE_NAME, "/testing-library/react"), rules: __assign({}, testingLibraryPlugin.configs["flat/react"].rules) }),
|
|
46
40
|
];
|
|
47
41
|
/**
|
|
48
42
|
* @example
|
|
@@ -59,6 +53,6 @@ exports.testingLibraryReact = [
|
|
|
59
53
|
* NOTE: Only choose this or the {@link testingLibraryReact}. Do not use
|
|
60
54
|
* both.
|
|
61
55
|
*/
|
|
62
|
-
|
|
63
|
-
__assign(__assign({}, testingLibrary), { name: "".concat(
|
|
56
|
+
export var testingLibraryDom = [
|
|
57
|
+
__assign(__assign({}, testingLibrary), { name: "".concat(BASE_NAME, "/testing-library/dom"), rules: __assign({}, testingLibraryPlugin.configs["flat/dom"].rules) }),
|
|
64
58
|
];
|
package/dist/typescript.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __read = (this && this.__read) || function (o, n) {
|
|
3
2
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
3
|
if (!m) return o;
|
|
@@ -24,14 +23,9 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
24
23
|
}
|
|
25
24
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
25
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.typescriptTypeChecking = exports.typescript = void 0;
|
|
32
|
-
var typescript_eslint_1 = __importDefault(require("typescript-eslint"));
|
|
33
|
-
var base_1 = require("./base");
|
|
34
|
-
var constants_1 = require("./constants");
|
|
26
|
+
import tseslint from "typescript-eslint";
|
|
27
|
+
import { base } from "./base.js";
|
|
28
|
+
import { BASE_NAME, TEST_FILES, TS_FILES } from "./constants.js";
|
|
35
29
|
/**
|
|
36
30
|
* @example
|
|
37
31
|
* ```ts
|
|
@@ -40,10 +34,10 @@ var constants_1 = require("./constants");
|
|
|
40
34
|
* export default config(gitignore(import.meta.url), ...configs.typescript);
|
|
41
35
|
* ```
|
|
42
36
|
*/
|
|
43
|
-
|
|
37
|
+
export var typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base), false), __read(tseslint.configs.strict), false), [
|
|
44
38
|
{
|
|
45
|
-
name: "".concat(
|
|
46
|
-
files:
|
|
39
|
+
name: "".concat(BASE_NAME, "/typescript"),
|
|
40
|
+
files: TS_FILES,
|
|
47
41
|
rules: {
|
|
48
42
|
// I normally do not want unified signatures since it helps improve type
|
|
49
43
|
// inference with function overloading
|
|
@@ -83,8 +77,8 @@ exports.typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base_1
|
|
|
83
77
|
},
|
|
84
78
|
},
|
|
85
79
|
{
|
|
86
|
-
name: "".concat(
|
|
87
|
-
files:
|
|
80
|
+
name: "".concat(BASE_NAME, "/typescript/tests"),
|
|
81
|
+
files: TEST_FILES,
|
|
88
82
|
rules: {
|
|
89
83
|
// allow tests to be less strict
|
|
90
84
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
@@ -105,9 +99,9 @@ exports.typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base_1
|
|
|
105
99
|
* export default config(gitignore(import.meta.url), ...configs.typescriptTypeChecking(import.meta.dirname));
|
|
106
100
|
* ```
|
|
107
101
|
*/
|
|
108
|
-
var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(__spreadArray(__spreadArray([], __read(
|
|
102
|
+
export var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(__spreadArray(__spreadArray([], __read(typescript), false), __read(tseslint.configs.strictTypeCheckedOnly), false), [
|
|
109
103
|
{
|
|
110
|
-
name: "".concat(
|
|
104
|
+
name: "".concat(BASE_NAME, "/typescript-type-checking-language-options"),
|
|
111
105
|
languageOptions: {
|
|
112
106
|
parserOptions: {
|
|
113
107
|
projectService: true,
|
|
@@ -116,8 +110,8 @@ var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(_
|
|
|
116
110
|
},
|
|
117
111
|
},
|
|
118
112
|
{
|
|
119
|
-
name: "".concat(
|
|
120
|
-
files:
|
|
113
|
+
name: "".concat(BASE_NAME, "/typescript-type-checking"),
|
|
114
|
+
files: TS_FILES,
|
|
121
115
|
rules: {
|
|
122
116
|
// I do not enable the `noUncheckedIndexedAccess` tsconfig option, so I
|
|
123
117
|
// still need to verify that stuff exists. There are other cases where I
|
|
@@ -141,8 +135,8 @@ var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(_
|
|
|
141
135
|
},
|
|
142
136
|
},
|
|
143
137
|
{
|
|
144
|
-
name: "".concat(
|
|
145
|
-
files:
|
|
138
|
+
name: "".concat(BASE_NAME, "/typescript-type-checking/tests"),
|
|
139
|
+
files: TEST_FILES,
|
|
146
140
|
rules: {
|
|
147
141
|
// like base typescript, can be less strict in tests
|
|
148
142
|
"@typescript-eslint/no-unsafe-return": "off",
|
|
@@ -151,4 +145,3 @@ var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(_
|
|
|
151
145
|
},
|
|
152
146
|
},
|
|
153
147
|
], false); };
|
|
154
|
-
exports.typescriptTypeChecking = typescriptTypeChecking;
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlaursen/eslint-config",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "7.0.0",
|
|
4
5
|
"description": "An eslint config used by mlaursen for most projects.",
|
|
5
6
|
"repository": "https://github.com/mlaursen/eslint-config.git",
|
|
6
7
|
"author": "Mikkel Laursen <mlaursen03@gmail.com>",
|
|
@@ -72,10 +73,11 @@
|
|
|
72
73
|
},
|
|
73
74
|
"scripts": {
|
|
74
75
|
"lint": "eslint .",
|
|
76
|
+
"typecheck": "tsc --noEmit",
|
|
77
|
+
"watch-typecheck": "pnpm run typecheck --watch",
|
|
75
78
|
"format": "prettier --write .",
|
|
76
79
|
"clean": "rm -rf dist",
|
|
77
80
|
"build": "tsc -p tsconfig.build.json",
|
|
78
|
-
"
|
|
79
|
-
"release": "pnpm run run-script scripts/release.ts"
|
|
81
|
+
"release": "tsx scripts/release.ts"
|
|
80
82
|
}
|
|
81
83
|
}
|