Skip to content

Commit 7f6160f

Browse files
feat: update eslint to version 9
1 parent a70dfdc commit 7f6160f

31 files changed

+1323
-1347
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

.prettierrc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
const { getPrettierConfig } = require("@harmonix-hub/prettier");
1+
// eslint-disable-next-line @typescript-eslint/no-require-imports
2+
const { prettierConfig } = require("@harmonix-hub/prettier");
23

34
/** @type {import("prettier").Config} */
45
const config = {
5-
...getPrettierConfig(),
6+
...prettierConfig,
7+
tabWidth: 2
68
};
79

810
module.exports = config;

eslint.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import tsConfig from "typescript-eslint";
2+
import prettierConfig from "eslint-config-prettier";
3+
import harmonixConfig from "@harmonix-hub/eslint";
4+
5+
/** @type import("eslint").Linter.Config */
6+
export default [
7+
{
8+
files: ["*.ts", "*.tsx"]
9+
},
10+
{
11+
ignores: ["dist", "node_modules", "**/*.js"]
12+
},
13+
...tsConfig.configs.recommended,
14+
harmonixConfig.tsConfigs,
15+
harmonixConfig.reactConfigs,
16+
harmonixConfig.jestConfigs,
17+
prettierConfig,
18+
];

package.json

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"prepare": "husky install",
77
"build": "turbo run build",
88
"lint": "turbo run lint --parallel",
9+
"lint:test": "eslint .",
910
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
1011
"test": "turbo run test --parallel",
1112
"clean": "turbo clean && rm -rf node_modules",
@@ -17,27 +18,32 @@
1718
"packages:version": "changeset version"
1819
},
1920
"devDependencies": {
21+
"@changesets/cli": "^2.27.10",
22+
"@commitlint/cli": "^19.6.0",
23+
"@commitlint/config-conventional": "^19.6.0",
24+
"@harmonix-hub/babel": "workspace:*",
2025
"@harmonix-hub/eslint": "workspace:*",
2126
"@harmonix-hub/prettier": "workspace:*",
2227
"@harmonix-hub/tsconfig": "workspace:*",
23-
"@harmonix-hub/babel": "workspace:*",
2428
"@types/cross-spawn": "6.0.6",
25-
"@changesets/cli": "^2.27.8",
26-
"@commitlint/cli": "^19.5.0",
27-
"@commitlint/config-conventional": "^19.5.0",
29+
"@types/jest": "^29.5.14",
2830
"changeset-conventional-commits": "^0.2.5",
29-
"@types/jest": "^29.5.13",
31+
"cross-spawn": "7.0.6",
32+
"husky": "^9.1.7",
3033
"jest": "^29.7.0",
31-
"cross-spawn": "7.0.3",
32-
"husky": "^9.1.6",
33-
"turbo": "^2.1.2",
34-
"typescript": "^5.2.2"
34+
"react": "^19.0.0",
35+
"turbo": "^2.3.3",
36+
"typescript": "^5.7.2",
37+
"typescript-eslint": "^8.17.0"
3538
},
3639
"optionalDependencies": {
37-
"@nx/nx-linux-x64-gnu": "^19.8.0"
40+
"@nx/nx-linux-x64-gnu": "^20.2.2"
3841
},
39-
"packageManager": "pnpm@8.9.0",
42+
"packageManager": "pnpm@9.15.0",
4043
"engines": {
4144
"node": ">=18"
45+
},
46+
"dependencies": {
47+
"@types/react": "^19.0.1"
4248
}
4349
}

packages/babel/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
],
1010
"scripts": {
1111
"build": "tsc -p tsconfig.json",
12-
"lint": "eslint . --ext ts",
12+
"lint": "eslint .",
1313
"clean": "rm -rf dist node_modules"
1414
},
1515
"dependencies": {
1616
"@types/babel__core": "^7.20.5",
1717
"@babel/core": "^7.26.0",
1818
"@babel/preset-env": "^7.26.0",
19-
"@babel/preset-react": "^7.25.9",
19+
"@babel/preset-react": "^7.26.3",
2020
"@babel/preset-typescript": "^7.26.0"
2121
},
2222
"devDependencies": {
2323
"@harmonix-hub/tsconfig": "workspace:*",
24-
"typescript": "^5.6.3"
24+
"typescript": "^5.7.2"
2525
},
2626
"publishConfig": {
2727
"access": "public"

packages/babel/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const config: TransformOptions = {
44
presets: [
55
["@babel/preset-env", { targets: { node: "current" } }],
66
["@babel/preset-react", { runtime: "automatic" }],
7-
"@babel/preset-typescript",
8-
],
7+
"@babel/preset-typescript"
8+
]
99
};
1010

1111
export default config;

packages/eslint/README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,34 @@ This package provides ESLint configurations for projects developed with Harmonix
77
You can install this ESLint configuration package using npm.
88

99
```bash
10-
npm install @harmonix-hub/eslint --save-dev
10+
npm install @typescript-eslint eslint-config-prettier @harmonix-hub/eslint --save-dev
1111
```
1212

1313
## Usage
1414

15-
To use the ESLint configurations provided by this package, create an ESLint configuration file in your project directory (e.g., `.eslintrc.js`, `.eslintrc.json`), and extend the configuration from `@harmonix-hub/eslint`.
15+
To use the ESLint configurations provided by this package, create an ESLint configuration file in your project directory (e.g., `eslint.config.mjs`), apply the configuration from `@harmonix-hub/eslint`.
1616

17-
Example `.eslintrc.js` configuration file:
17+
Example `eslint.config.mjs` configuration file:
1818

1919
```js
20-
const { getEslintConfig } = require("@harmonix-hub/eslint");
21-
22-
const baseConfig = getEslintConfig();
20+
import tsConfig from "typescript-eslint";
21+
import prettierConfig from "eslint-config-prettier";
22+
import harmonixConfig from "@harmonix-hub/eslint";
2323

2424
/** @type import("eslint").Linter.Config */
25-
module.exports = {
26-
...baseConfig,
27-
parserOptions: {
28-
...baseConfig.parserOptions,
25+
export default [
26+
{
27+
ignores: ["dist", "node_modules", "**/*.js"]
28+
},
29+
{
30+
files: ["**/*.ts", "**/*.tsx"]
2931
},
30-
};
32+
...tsConfig.configs.recommended,
33+
harmonixConfig.tsConfigs,
34+
harmonixConfig.reactConfigs,
35+
harmonixConfig.jestConfigs,
36+
prettierConfig,
37+
];
3138
```
3239

3340
By extending `@harmonix-hub/eslint`, you inherit the recommended ESLint rules for Harmonix hub projects.

packages/eslint/custom.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare module "eslint-plugin-react-hooks" {
2+
import type { ESLint, Rule } from "eslint";
3+
const plugin: Omit<ESLint.Plugin, "configs"> & {
4+
configs: {
5+
recommended: Partial<Rules>;
6+
};
7+
rules: Rule;
8+
};
9+
export default plugin;
10+
}

packages/eslint/jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { jestConfig } from "@harmonix-hub/testing";
22

33
module.exports = {
4-
...jestConfig(),
4+
...jestConfig()
55
};

0 commit comments

Comments
 (0)