@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 CHANGED
@@ -1,11 +1,5 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
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
- exports.base = [
18
- js_1.default.configs.recommended,
11
+ export var base = [
12
+ eslint.configs.recommended,
19
13
  {
20
- name: "".concat(constants_1.BASE_NAME, "/base"),
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": constants_1.DEV_WARNING_PROD_ERROR,
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JSX_FILES = exports.TEST_FILES = exports.TS_FILES = exports.BASE_NAME = exports.DEV_WARNING_PROD_ERROR = void 0;
4
- exports.DEV_WARNING_PROD_ERROR = process.env.NODE_ENV !== "production" ? "warn" : "error";
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
- exports.JSX_FILES = ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"];
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
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.frontendTypeChecking = exports.frontend = void 0;
29
- var jest_1 = require("./jest");
30
- var jsxA11y_1 = require("./jsxA11y");
31
- var react_1 = require("./react");
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
- exports.frontend = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(typescript_1.typescript), false), __read(react_1.react), false), __read(jsxA11y_1.jsxA11y), false), __read(jest_1.jest), false), __read(jest_1.jestDom), false), __read(testing_library_1.testingLibraryReact), false);
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((0, typescript_1.typescriptTypeChecking)(tsconfigRootDir)), false), __read(react_1.react), false), __read(jsxA11y_1.jsxA11y), false), __read(jest_1.jest), false), __read(jest_1.jestDom), false), __read(testing_library_1.testingLibraryReact), false); };
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
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 = (0, node_url_1.fileURLToPath)(importMetaUrl);
28
- var __dirname = node_path_1.default.dirname(__filename);
29
- var gitignorePath = node_path_1.default.resolve(__dirname, ".gitignore");
30
- return (0, compat_1.includeIgnoreFile)(gitignorePath);
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gitignore = exports.config = exports.configs = void 0;
4
- var typescript_eslint_1 = require("typescript-eslint");
5
- Object.defineProperty(exports, "config", { enumerable: true, get: function () { return typescript_eslint_1.config; } });
6
- var base_1 = require("./base");
7
- var frontend_1 = require("./frontend");
8
- var gitignore_1 = require("./gitignore");
9
- Object.defineProperty(exports, "gitignore", { enumerable: true, get: function () { return gitignore_1.gitignore; } });
10
- var jest_1 = require("./jest");
11
- var jsxA11y_1 = require("./jsxA11y");
12
- var next_1 = require("./next");
13
- var react_1 = require("./react");
14
- var testing_library_1 = require("./testing-library");
15
- var typescript_1 = require("./typescript");
16
- exports.configs = {
17
- base: base_1.base,
18
- jest: jest_1.jest,
19
- jestDom: jest_1.jestDom,
20
- react: react_1.react,
21
- typescript: typescript_1.typescript,
22
- typescriptTypeChecking: typescript_1.typescriptTypeChecking,
23
- testingLibraryDom: testing_library_1.testingLibraryDom,
24
- testingLibraryReact: testing_library_1.testingLibraryReact,
25
- frontend: frontend_1.frontend,
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
- exports.default = {
31
- config: typescript_eslint_1.config,
32
- configs: exports.configs,
33
- gitignore: gitignore_1.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
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
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
- exports.jest = [
30
- __assign({ name: "".concat(constants_1.BASE_NAME, "/jest"), files: constants_1.TEST_FILES }, eslint_plugin_jest_1.default.configs["flat/recommended"]),
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
- exports.jestDom = [
41
- __assign({ name: "".concat(constants_1.BASE_NAME, "/jest-dom"), files: constants_1.TEST_FILES }, eslint_plugin_jest_dom_1.default.configs["flat/recommended"]),
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
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
- exports.jsxA11y = [
29
- __assign(__assign({ name: "".concat(constants_1.BASE_NAME, "/jsx-a11y"), files: constants_1.JSX_FILES }, eslint_plugin_jsx_a11y_1.default.flatConfigs.recommended), { rules: {
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(constants_1.BASE_NAME, "/jsx-a11y/testing"),
36
- files: constants_1.TEST_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
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
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
- exports.next = [
23
+ export var next = [
30
24
  {
31
- name: "".concat(constants_1.BASE_NAME, "/next"),
25
+ name: "".concat(BASE_NAME, "/next"),
32
26
  plugins: {
33
27
  // @ts-expect-error There is a bad typing atm
34
- "@next/next": (0, compat_1.fixupPluginRules)(eslint_plugin_next_1.default),
28
+ "@next/next": fixupPluginRules(nextPlugin),
35
29
  },
36
- rules: __assign({}, eslint_plugin_next_1.default.configs.recommended.rules),
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
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 = eslint_plugin_react_1.default.configs.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
- exports.react = [
35
+ export var react = [
42
36
  {
43
- name: "".concat(constants_1.BASE_NAME, "/react"),
44
- files: constants_1.JSX_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": eslint_plugin_react_hooks_1.default }),
51
- rules: __assign(__assign(__assign(__assign({}, recommendedRules), jsxRuntimeRules), eslint_plugin_react_hooks_1.default.configs.recommended.rules), { "react-hooks/exhaustive-deps": [
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)",
@@ -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
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
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: constants_1.TEST_FILES,
16
+ files: TEST_FILES,
23
17
  plugins: {
24
18
  // @ts-expect-error There is a bad typing atm
25
- "testing-library": (0, compat_1.fixupPluginRules)(eslint_plugin_testing_library_1.default),
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
- exports.testingLibraryReact = [
45
- __assign(__assign({}, testingLibrary), { name: "".concat(constants_1.BASE_NAME, "/testing-library/react"), rules: __assign({}, eslint_plugin_testing_library_1.default.configs["flat/react"].rules) }),
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
- exports.testingLibraryDom = [
63
- __assign(__assign({}, testingLibrary), { name: "".concat(constants_1.BASE_NAME, "/testing-library/dom"), rules: __assign({}, eslint_plugin_testing_library_1.default.configs["flat/dom"].rules) }),
56
+ export var testingLibraryDom = [
57
+ __assign(__assign({}, testingLibrary), { name: "".concat(BASE_NAME, "/testing-library/dom"), rules: __assign({}, testingLibraryPlugin.configs["flat/dom"].rules) }),
64
58
  ];
@@ -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
- var __importDefault = (this && this.__importDefault) || function (mod) {
28
- return (mod && mod.__esModule) ? mod : { "default": mod };
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
- exports.typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base_1.base), false), __read(typescript_eslint_1.default.configs.strict), false), [
37
+ export var typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base), false), __read(tseslint.configs.strict), false), [
44
38
  {
45
- name: "".concat(constants_1.BASE_NAME, "/typescript"),
46
- files: constants_1.TS_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(constants_1.BASE_NAME, "/typescript/tests"),
87
- files: constants_1.TEST_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(exports.typescript), false), __read(typescript_eslint_1.default.configs.strictTypeCheckedOnly), false), [
102
+ export var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(__spreadArray(__spreadArray([], __read(typescript), false), __read(tseslint.configs.strictTypeCheckedOnly), false), [
109
103
  {
110
- name: "".concat(constants_1.BASE_NAME, "/typescript-type-checking-language-options"),
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(constants_1.BASE_NAME, "/typescript-type-checking"),
120
- files: constants_1.TS_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(constants_1.BASE_NAME, "/typescript-type-checking/tests"),
145
- files: constants_1.TEST_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
- "version": "6.1.0",
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
- "run-script": "tsx --tsconfig scripts/tsconfig.json",
79
- "release": "pnpm run run-script scripts/release.ts"
81
+ "release": "tsx scripts/release.ts"
80
82
  }
81
83
  }