@mlaursen/eslint-config 5.1.3 → 5.2.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/README.md CHANGED
@@ -22,6 +22,16 @@ export default config(gitignore(import.meta.url), ...configs.frontend);
22
22
 
23
23
  // strict type checking
24
24
  export default config(gitignore(import.meta.url), ...configs.frontendTypeChecking(import.meta.dirname));
25
+
26
+ // NOTE: This is recommended for strict type checking. Callable as:
27
+ // `cross-env STRICT_TYPING=true eslint "**/*.{ts,tsx,mts,mtsx,js,jsx,mjs,cjs}`
28
+ //
29
+ // strict type checking with an environment variable. uncomment the following
30
+ // line to enable it in your editor
31
+ // const strict = true || process.env.STRICT_TYPING === 'true';
32
+ const strict = process.env.STRICT_TYPING === 'true';
33
+ const frontend = strict ? configs.frontendTypeChecking(import.meta.dirname) : configs.frontend
34
+ export default (gitignore(import.meta.url), ...frontend);
25
35
  ```
26
36
 
27
37
  The `config` export is the `typescript-eslint.config()` function to provide type
package/dist/base.js CHANGED
@@ -1,15 +1,4 @@
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
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
@@ -26,17 +15,25 @@ var constants_1 = require("./constants");
26
15
  * ```
27
16
  */
28
17
  exports.base = [
29
- __assign(__assign({}, js_1.default.configs.recommended), { name: "".concat(constants_1.BASE_NAME, "/base"), rules: __assign(__assign({}, js_1.default.configs.recommended.rules), {
18
+ js_1.default.configs.recommended,
19
+ {
20
+ name: "".concat(constants_1.BASE_NAME, "/base"),
21
+ rules: {
22
+ // I use typescript instead
23
+ "no-undef": "off",
30
24
  // You normally do not want `console.{whatever}` in prod but is fine for
31
25
  // development in debugging
32
- "no-console": constants_1.DEV_WARNING_PROD_ERROR, "no-use-before-define": "warn",
26
+ "no-console": constants_1.DEV_WARNING_PROD_ERROR,
27
+ "no-use-before-define": "warn",
33
28
  // I want to enforce all statements to require curly braces even if it
34
29
  // could be omitted for consistency
35
- curly: "error",
30
+ curly: "error",
36
31
  // Since this is auto-fixable, I like `{ someproperty }` instead of
37
32
  // `{ someproperty: someproperty }`
38
- "object-shorthand": ["error", "always"],
33
+ "object-shorthand": ["error", "always"],
39
34
  // This is about the same as `object-shorthand`. Only rename if it has to
40
35
  // be renamed
41
- "no-useless-rename": ["error"] }) }),
36
+ "no-useless-rename": ["error"],
37
+ },
38
+ },
42
39
  ];