@mlaursen/eslint-config 5.1.1 → 5.1.2

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/jsxA11y.js CHANGED
@@ -21,5 +21,17 @@ var constants_1 = require("./constants");
21
21
  exports.jsxA11y = [
22
22
  __assign(__assign({ files: constants_1.JSX_FILES }, eslint_plugin_jsx_a11y_1.default.flatConfigs.recommended), { languageOptions: {
23
23
  globals: __assign({}, globals_1.default.browser),
24
+ }, rules: {
25
+ // I **only** use autoFocus within dialogs which provide the correct
26
+ // context for screen readers.
27
+ "jsx-a11y/no-autofocus": "off",
24
28
  } }),
29
+ {
30
+ files: constants_1.TEST_FILES,
31
+ rules: {
32
+ "jsx-a11y/anchor-has-content": "off",
33
+ "jsx-a11y/click-events-have-key-events": "off",
34
+ "jsx-a11y/no-static-element-interactions": "off",
35
+ },
36
+ },
25
37
  ];
package/dist/react.js CHANGED
@@ -40,7 +40,12 @@ exports.react = [
40
40
  },
41
41
  },
42
42
  plugins: __assign(__assign({}, reactPlugins), { "react-hooks": eslint_plugin_react_hooks_1.default }),
43
- rules: __assign(__assign(__assign({}, recommendedRules), jsxRuntimeRules), eslint_plugin_react_hooks_1.default.configs.recommended.rules),
43
+ rules: __assign(__assign(__assign(__assign({}, recommendedRules), jsxRuntimeRules), eslint_plugin_react_hooks_1.default.configs.recommended.rules), { "react-hooks/exhaustive-deps": [
44
+ "error",
45
+ {
46
+ additionalHooks: "(useIsomorphicLayoutEffect)",
47
+ },
48
+ ] }),
44
49
  languageOptions: __assign(__assign({}, flat.recommended.languageOptions), { globals: __assign({}, globals_1.default.browser) }),
45
50
  },
46
51
  ];
@@ -63,6 +63,7 @@ exports.typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base_1
63
63
  varsIgnorePattern: "^_",
64
64
  },
65
65
  ],
66
+ "no-use-before-define": "off",
66
67
  "@typescript-eslint/no-use-before-define": [
67
68
  "warn",
68
69
  { ignoreTypeReferences: true },
@@ -92,6 +93,38 @@ exports.typescript = __spreadArray(__spreadArray(__spreadArray([], __read(base_1
92
93
  * ```
93
94
  */
94
95
  var typescriptTypeChecking = function (tsconfigRootDir) { return __spreadArray(__spreadArray(__spreadArray([], __read(exports.typescript), false), __read(typescript_eslint_1.default.configs.strictTypeCheckedOnly), false), [
96
+ {
97
+ rules: {
98
+ // I do not enable the `noUncheckedIndexedAccess` tsconfig option, so I
99
+ // still need to verify that stuff exists. There are other cases where I
100
+ // know it exists, so I can ignore those as well
101
+ "@typescript-eslint/no-unnecessary-condition": "off",
102
+ // I never use `this`
103
+ "@typescript-eslint/unbound-method": "off",
104
+ "@typescript-eslint/restrict-template-expressions": [
105
+ "error",
106
+ {
107
+ allowNumber: true,
108
+ },
109
+ ],
110
+ // I want to allow `onClick={async (event) => { ... }}`
111
+ "@typescript-eslint/no-misused-promises": [
112
+ "error",
113
+ {
114
+ checksVoidReturn: false,
115
+ },
116
+ ],
117
+ },
118
+ },
119
+ {
120
+ files: constants_1.TEST_FILES,
121
+ rules: {
122
+ // like base typescript, can be less strict in tests
123
+ "@typescript-eslint/no-unsafe-return": "off",
124
+ "@typescript-eslint/no-unsafe-assignment": "off",
125
+ "@typescript-eslint/restrict-template-expressions": "off",
126
+ },
127
+ },
95
128
  {
96
129
  languageOptions: {
97
130
  parserOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlaursen/eslint-config",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "description": "An eslint config used by mlaursen for most projects.",
5
5
  "repository": "https://github.com/mlaursen/eslint-config.git",
6
6
  "author": "Mikkel Laursen <mlaursen03@gmail.com>",
@@ -31,6 +31,7 @@
31
31
  "eslint-plugin-react": "^7.37.1",
32
32
  "eslint-plugin-react-hooks": "^5.0.0",
33
33
  "eslint-plugin-testing-library": "^6.3.0",
34
+ "globals": "^15.11.0",
34
35
  "typescript-eslint": "^8.8.1"
35
36
  },
36
37
  "devDependencies": {