@keeex/eslint-config 2.5.0 → 2.5.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 KeeeX SAS
3
+ Copyright (c) 2025 KeeeX SAS
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
6
  associated documentation files (the "Software"), to deal in the Software without restriction,
package/README.md CHANGED
@@ -124,8 +124,8 @@ following options:
124
124
  // "environments": "webservice"
125
125
  {
126
126
  "environments": {
127
- "node": ["", "src/bin/**", "src/server/**"],
128
- "webapp": ["src/webapp/**", "webres/*/js/**"],
127
+ "node": ["", "src/bin/**", "src/server/**", "src/tests/server/**"],
128
+ "webapp": ["src/webapp/**", "webres/*/js/**", "src/tests/webapp/**"],
129
129
  "mocha": ["src/**/*.test.*", "src/tests/**/*"]
130
130
  }
131
131
  }
package/package.json CHANGED
@@ -16,20 +16,20 @@
16
16
  },
17
17
  "description": "Common eslint configuration",
18
18
  "devDependencies": {
19
- "@eslint/compat": "^1.2.7",
19
+ "@eslint/compat": "^1.2.8",
20
20
  "@eslint/js": "^9.12.0",
21
- "eslint": "^9.22.0",
22
- "eslint-import-resolver-typescript": "^4.2.2",
21
+ "eslint": "^9.24.0",
22
+ "eslint-import-resolver-typescript": "^4.3.2",
23
23
  "eslint-import-resolver-webpack": "^0.13.10",
24
- "eslint-plugin-import-x": "^4.9.1",
24
+ "eslint-plugin-import-x": "^4.10.2",
25
25
  "eslint-plugin-mocha": "^10.5.0",
26
26
  "eslint-plugin-promise": "^7.2.1",
27
- "eslint-plugin-react": "^7.37.4",
27
+ "eslint-plugin-react": "^7.37.5",
28
28
  "eslint-plugin-react-hooks": "^5.2.0",
29
29
  "eslint-plugin-tsdoc": "^0.4.0",
30
30
  "globals": "^16.0.0",
31
31
  "prettier": "^3.5.3",
32
- "typescript-eslint": "^8.27.0"
32
+ "typescript-eslint": "^8.29.1"
33
33
  },
34
34
  "exports": {
35
35
  ".": "./src/index.js",
@@ -116,5 +116,5 @@
116
116
  "test": "echo No test for this project"
117
117
  },
118
118
  "type": "module",
119
- "version": "2.5.0"
119
+ "version": "2.5.2"
120
120
  }
@@ -1,4 +1,4 @@
1
- import eslintPluginImportX from "eslint-plugin-import-x";
1
+ import {flatConfigs} from "eslint-plugin-import-x";
2
2
 
3
3
  import * as pathutils from "../pathutils.js";
4
4
  import * as sections from "../sections.js";
@@ -11,10 +11,10 @@ import * as sections from "../sections.js";
11
11
  // eslint-disable-next-line max-lines-per-function
12
12
  export const apply = (configResult, eslintConfig) => {
13
13
  if (eslintConfig.import === false) return;
14
- configResult.push({...eslintPluginImportX.flatConfigs.recommended, languageOptions: {}});
14
+ configResult.push({...flatConfigs.recommended, languageOptions: {}});
15
15
  if (eslintConfig.typescript) {
16
16
  configResult.push({
17
- ...eslintPluginImportX.flatConfigs.typescript,
17
+ ...flatConfigs.typescript,
18
18
  name: "import-x/typescript-recommended",
19
19
  });
20
20
  }
@@ -20,6 +20,7 @@ export const apply = (configResult, eslintConfig) => {
20
20
  "no-magic-numbers": "off",
21
21
  "no-setup-in-describe": "off",
22
22
  "prefer-arrow-callback": "off",
23
+ "sort-keys": "off",
23
24
  });
24
25
  sections.configureRules(override, "mocha", {
25
26
  "no-exports": "off",
@@ -28,6 +29,7 @@ export const apply = (configResult, eslintConfig) => {
28
29
  });
29
30
  if (eslintConfig.typescript) {
30
31
  sections.configureRules(override, "@typescript-eslint", {
32
+ "class-methods-use-this": "off",
31
33
  "explicit-function-return-type": "off",
32
34
  "init-declarations": "off",
33
35
  "max-params": "off",
@@ -10,7 +10,7 @@ import {getReactFullConfig} from "./reactfullconfig.js";
10
10
  export const apply = (configResult, eslintConfig) => {
11
11
  const reactCfg = getReactFullConfig(eslintConfig.react);
12
12
  if (!reactCfg.react) return;
13
- const files = getFilesEnv(eslintConfig, ["webapp", "mobile"], undefined, {
13
+ const files = getFilesEnv(eslintConfig, ["node", "webapp", "mobile"], undefined, {
14
14
  cjs: true,
15
15
  esm: true,
16
16
  javascript: true,
@@ -40,7 +40,7 @@ export const apply = (configResult, eslintConfig) => {
40
40
  "error",
41
41
  {children: "never", propElementValues: "always", props: "never"},
42
42
  ],
43
- "jsx-curly-newline": "warn",
43
+ "jsx-curly-newline": "off",
44
44
  "jsx-curly-spacing": "warn",
45
45
  "jsx-equals-spacing": "warn",
46
46
  "jsx-filename-extension": ["error", {extensions: [".js", ".tsx"]}],
@@ -66,6 +66,7 @@ export const apply = (configResult, eslintConfig) => {
66
66
  "no-redundant-should-component-update": "error",
67
67
  "no-this-in-sfc": "error",
68
68
  "no-typos": "error",
69
+ "no-unescaped-entities": "off",
69
70
  "no-unsafe": "error",
70
71
  "no-unstable-nested-components": "error",
71
72
  "no-unused-class-component-methods": "warn",
@@ -88,13 +88,9 @@ export const addDependency = (depName, version) => {
88
88
  * Returns false if the process ended with another status than 0.
89
89
  */
90
90
  const runProcess = (cmd, ...args) => {
91
- const res = cp.spawnSync(cmd, args, {encoding: "utf8"});
91
+ const res = cp.spawnSync(cmd, args, {encoding: "utf8", stdio: "inherit"});
92
92
  if (res.status !== 0) {
93
93
  console.log(`Command ${cmd} failed with exit code ${res.status}`);
94
- console.log("stdout:");
95
- console.log(res.stdout);
96
- console.log("stderr:");
97
- console.log(res.stderr);
98
94
  return false;
99
95
  }
100
96
  return true;
package/src/pathutils.js CHANGED
@@ -11,8 +11,8 @@ const envShorthands = {
11
11
  weblibrary: {webapp: "src/**", mocha: ["src/**/*.test.*", "src/tests/**/*"]},
12
12
  webservice: {
13
13
  mocha: ["src/**/*.test.*", "src/tests/**/*"],
14
- node: ["", "bin/**", "src/bin/**", "src/server/**"],
15
- webapp: ["src/webapp/**", "webres/*/js/**"],
14
+ node: ["", "bin/**", "src/bin/**", "src/server/**", "src/tests/server/**"],
15
+ webapp: ["src/webapp/**", "webres/*/js/**", "src/tests/webapp/**"],
16
16
  },
17
17
  };
18
18