@mlaursen/eslint-config 5.1.1 → 5.1.3

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.d.ts CHANGED
@@ -1,2 +1,10 @@
1
1
  import { type TSESLint } from "@typescript-eslint/utils";
2
+ /**
3
+ * @example
4
+ * ```js
5
+ * import { config, configs } from "@mlaursen/eslint-config";
6
+ *
7
+ * export default configs.base;
8
+ * ```
9
+ */
2
10
  export declare const base: TSESLint.FlatConfig.ConfigArray;
package/dist/base.js CHANGED
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
@@ -6,23 +17,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
17
  exports.base = void 0;
7
18
  var js_1 = __importDefault(require("@eslint/js"));
8
19
  var constants_1 = require("./constants");
20
+ /**
21
+ * @example
22
+ * ```js
23
+ * import { config, configs } from "@mlaursen/eslint-config";
24
+ *
25
+ * export default configs.base;
26
+ * ```
27
+ */
9
28
  exports.base = [
10
- js_1.default.configs.recommended,
11
- {
12
- rules: {
29
+ __assign(__assign({}, js_1.default.configs.recommended), { name: "".concat(constants_1.BASE_NAME, "/base"), rules: __assign(__assign({}, js_1.default.configs.recommended.rules), {
13
30
  // You normally do not want `console.{whatever}` in prod but is fine for
14
31
  // development in debugging
15
- "no-console": constants_1.DEV_WARNING_PROD_ERROR,
16
- "no-use-before-define": "warn",
32
+ "no-console": constants_1.DEV_WARNING_PROD_ERROR, "no-use-before-define": "warn",
17
33
  // I want to enforce all statements to require curly braces even if it
18
34
  // could be omitted for consistency
19
- curly: "error",
35
+ curly: "error",
20
36
  // Since this is auto-fixable, I like `{ someproperty }` instead of
21
37
  // `{ someproperty: someproperty }`
22
- "object-shorthand": ["error", "always"],
38
+ "object-shorthand": ["error", "always"],
23
39
  // This is about the same as `object-shorthand`. Only rename if it has to
24
40
  // be renamed
25
- "no-useless-rename": ["error"],
26
- },
27
- },
41
+ "no-useless-rename": ["error"] }) }),
28
42
  ];
@@ -1,3 +1,5 @@
1
1
  export declare const DEV_WARNING_PROD_ERROR: string;
2
+ export declare const BASE_NAME = "@mlaursen/eslint-config";
3
+ export declare const TS_FILES: string[];
2
4
  export declare const TEST_FILES: string[];
3
5
  export declare const JSX_FILES: string[];
package/dist/constants.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JSX_FILES = exports.TEST_FILES = exports.DEV_WARNING_PROD_ERROR = void 0;
3
+ exports.JSX_FILES = exports.TEST_FILES = exports.TS_FILES = exports.BASE_NAME = exports.DEV_WARNING_PROD_ERROR = void 0;
4
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}"];
5
7
  exports.TEST_FILES = [
6
8
  "**/__tests__/**",
7
9
  "**/*.{spec,test}.{ts,tsx,js,jsx}",
@@ -1,3 +1,25 @@
1
1
  import { type TSESLint } from "@typescript-eslint/utils";
2
+ /**
3
+ * @example
4
+ * ```ts
5
+ * import { config, configs, gitignore } from "@mlaursen/eslint-config";
6
+ *
7
+ * export default config(
8
+ * gitignore(import.meta.url),
9
+ * ...configs.typescript
10
+ * );
11
+ * ```
12
+ */
2
13
  export declare const frontend: TSESLint.FlatConfig.ConfigArray;
14
+ /**
15
+ * @example
16
+ * ```ts
17
+ * import { config, configs, gitignore } from "@mlaursen/eslint-config";
18
+ *
19
+ * export default config(
20
+ * gitignore(import.meta.url),
21
+ * ...configs.typescriptTypeChecking(import.meta.dirname)
22
+ * );
23
+ * ```
24
+ */
3
25
  export declare const frontendTypeChecking: (tsconfigRootDir: string) => TSESLint.FlatConfig.ConfigArray;
package/dist/frontend.js CHANGED
@@ -31,6 +31,28 @@ var jsxA11y_1 = require("./jsxA11y");
31
31
  var react_1 = require("./react");
32
32
  var testing_library_1 = require("./testing-library");
33
33
  var typescript_1 = require("./typescript");
34
+ /**
35
+ * @example
36
+ * ```ts
37
+ * import { config, configs, gitignore } from "@mlaursen/eslint-config";
38
+ *
39
+ * export default config(
40
+ * gitignore(import.meta.url),
41
+ * ...configs.typescript
42
+ * );
43
+ * ```
44
+ */
34
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);
46
+ /**
47
+ * @example
48
+ * ```ts
49
+ * import { config, configs, gitignore } from "@mlaursen/eslint-config";
50
+ *
51
+ * export default config(
52
+ * gitignore(import.meta.url),
53
+ * ...configs.typescriptTypeChecking(import.meta.dirname)
54
+ * );
55
+ * ```
56
+ */
35
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); };
36
58
  exports.frontendTypeChecking = frontendTypeChecking;
@@ -1,2 +1,18 @@
1
1
  import { type TSESLint } from "@typescript-eslint/utils";
2
+ /**
3
+ * @example
4
+ * ```ts
5
+ * import { config, configs, gitignore } from "@mlaursen/eslint-config";
6
+ *
7
+ * export default config(gitignore(import.meta.url), ...configs.typescript);
8
+ * ```
9
+ *
10
+ * @example .gitignore in a different folder
11
+ * ```ts
12
+ * import { config, configs, gitignore } from "@mlaursen/eslint-config";
13
+ * import { join } from "node:path";
14
+ *
15
+ * export default config(gitignore(join(import.meta.url, "..", "..")), ...configs.typescript);
16
+ * ```
17
+ */
2
18
  export declare function gitignore(importMetaUrl: string): TSESLint.FlatConfig.Config;
package/dist/gitignore.js CHANGED
@@ -7,6 +7,22 @@ exports.gitignore = gitignore;
7
7
  var compat_1 = require("@eslint/compat");
8
8
  var node_path_1 = __importDefault(require("node:path"));
9
9
  var node_url_1 = require("node:url");
10
+ /**
11
+ * @example
12
+ * ```ts
13
+ * import { config, configs, gitignore } from "@mlaursen/eslint-config";
14
+ *
15
+ * export default config(gitignore(import.meta.url), ...configs.typescript);
16
+ * ```
17
+ *
18
+ * @example .gitignore in a different folder
19
+ * ```ts
20
+ * import { config, configs, gitignore } from "@mlaursen/eslint-config";
21
+ * import { join } from "node:path";
22
+ *
23
+ * export default config(gitignore(join(import.meta.url, "..", "..")), ...configs.typescript);
24
+ * ```
25
+ */
10
26
  function gitignore(importMetaUrl) {
11
27
  var __filename = (0, node_url_1.fileURLToPath)(importMetaUrl);
12
28
  var __dirname = node_path_1.default.dirname(__filename);