@jsenv/eslint-config-relax 1.2.12 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/eslint-config-relax",
3
- "version": "1.2.12",
3
+ "version": "1.3.0",
4
4
  "description": "A pleaseant ESLint configuration for any project",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -33,7 +33,7 @@
33
33
  "@babel/eslint-parser": "7.25.9",
34
34
  "globals": "15.12.0",
35
35
  "@jsenv/eslint-import-resolver": "8.2.0",
36
- "@jsenv/urls": "2.5.2",
36
+ "@jsenv/urls": "2.5.3",
37
37
  "eslint-plugin-import-x": "4.4.0",
38
38
  "eslint-plugin-html": "8.1.2",
39
39
  "eslint-plugin-react": "7.37.2",
@@ -34,6 +34,7 @@ export const eslintConfigRelax = ({
34
34
  prettier,
35
35
  prettierSortImport,
36
36
  jsxPragmaAuto = false,
37
+ preact = false,
37
38
  importResolutionLogLevel,
38
39
 
39
40
  browserFiles = [],
@@ -45,7 +46,7 @@ export const eslintConfigRelax = ({
45
46
  const packageBuffer = readFileSync(packageJsonFileUrl);
46
47
  packageObject = JSON.parse(String(packageBuffer));
47
48
  } catch {}
48
- const { devDependencies = {} } = packageObject;
49
+ const { dependencies = {}, devDependencies = {} } = packageObject;
49
50
  if (prettier === undefined) {
50
51
  if (devDependencies.prettier || packageObject.prettier) {
51
52
  prettier = true;
@@ -61,6 +62,11 @@ export const eslintConfigRelax = ({
61
62
  prettierSortImport = true;
62
63
  }
63
64
  }
65
+ if (preact === undefined) {
66
+ if (dependencies.preact || devDependencies.preact) {
67
+ preact = true;
68
+ }
69
+ }
64
70
 
65
71
  const browserExtensions = [".js", ".jsx"];
66
72
  browserFiles = [
@@ -180,6 +186,14 @@ export const eslintConfigRelax = ({
180
186
  rules: {
181
187
  ...rulesReactRelax,
182
188
  ...(jsxPragmaAuto ? { "react/react-in-jsx-scope": ["off"] } : {}),
189
+ ...(preact
190
+ ? {
191
+ "react/no-unknown-property": [
192
+ "error",
193
+ { ignore: ["stroke-width"] },
194
+ ],
195
+ }
196
+ : {}),
183
197
  },
184
198
  },
185
199
  // browser files