Skip to content

Commit

Permalink
chore(*): update eslint deps, migrate style rules
Browse files Browse the repository at this point in the history
  • Loading branch information
chyzwar committed Sep 5, 2024
1 parent 8783873 commit 9dcf34c
Show file tree
Hide file tree
Showing 50 changed files with 730 additions and 1,028 deletions.
3 changes: 1 addition & 2 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

module.exports = {
extends: [
"@commitlint/config-conventional",
],
rules: {
"scope-empty": [2, "never"],
},
};
};
6 changes: 3 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export default [
ignores: ["**/dist/", "**/lib/", "packages/sea/bin/", "node_modules/"],
},
{
files: ["packages/*/examples/**/*.{ts,tsx}" ],
files: ["packages/*/examples/**/*.{ts,tsx}"],
...tsEslint.configs.disableTypeChecked,
},
{
files: ["packages/*/src/**/*.{ts,tsx}" ],
files: ["packages/*/src/**/*.{ts,tsx}"],
languageOptions: {
parserOptions: {
tsconfigRootDir: import.meta.dirname,
Expand All @@ -21,4 +21,4 @@ export default [
},
},
},
];
];
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
},
"dependencies": {
"@chyzwar/eslint-config": "^0.2.0",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@lerna-lite/cli": "^3.7.1",
"@lerna-lite/publish": "^3.7.1",
"@lerna-lite/version": "^3.7.1",
"@types/node": "^22.0.0",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@lerna-lite/cli": "^3.9.0",
"@lerna-lite/publish": "^3.9.0",
"@lerna-lite/version": "^3.9.0",
"@types/node": "^22.5.4",
"conventional-changelog-conventionalcommits": "^7.0.2",
"eslint": "^9.8.0",
"husky": "^9.1.4",
"lint-staged": "^15.2.7",
"eslint": "^9.9.1",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
Expand Down
19 changes: 13 additions & 6 deletions packages/eslint-config/node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import eslint from "@eslint/js";
import tsEslint from "typescript-eslint";
import stylistic from "@stylistic/eslint-plugin";
import typescript from "./rules/typescript.js";
import jest from "./rules/jest.js";
import esm from "./rules/esm.js";
Expand All @@ -8,16 +9,22 @@ import globals from "globals";
export default tsEslint.config(
eslint.configs.recommended,
...tsEslint.configs.all,
...tsEslint.configs.strictTypeChecked,
...tsEslint.configs.strictTypeChecked,
...typescript,
...jest,
...esm,
...esm,
stylistic.configs.customize({
indent: 2,
quotes: "double",
semi: true,
jsx: true,
}),
{
files: [
"**/*.js",
"**/*.js",
"**/*.cjs",
"**/*.mjs",

"**/drizzle.config.ts",
"**/runner.config.ts",
"**/vite.config.ts",
Expand All @@ -35,5 +42,5 @@ export default tsEslint.config(
...globals.node,
},
},
}
);
},
);
9 changes: 5 additions & 4 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
},
"dependencies": {
"@chyzwar/tsconfig": "^0.2.28",
"@eslint/js": "^9.8.0",
"eslint-plugin-jest": "^28.6.0",
"globals": "^15.8.0",
"typescript-eslint": "^7.18.0"
"@eslint/js": "^9.9.1",
"@stylistic/eslint-plugin": "^2.7.2",
"eslint-plugin-jest": "^28.8.3",
"globals": "^15.9.0",
"typescript-eslint": "^8.4.0"
},
"peerDependencies": {
"eslint": "^9.2.0"
Expand Down
17 changes: 12 additions & 5 deletions packages/eslint-config/react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import eslint from "@eslint/js";
import tsEslint from "typescript-eslint";
import typescript from "./rules/typescript.js";
import stylistic from "@stylistic/eslint-plugin";
import jest from "./rules/jest.js";
import esm from "./rules/esm.js";
import globals from "globals";
Expand All @@ -11,13 +12,19 @@ export default tsEslint.config(
...tsEslint.configs.strictTypeChecked,
...typescript,
...jest,
...esm,
...esm,
stylistic.configs.customize({
indent: 2,
quotes: "double",
semi: true,
jsx: true,
}),
{
files: [
"**/*.js",
"**/*.js",
"**/*.cjs",
"**/*.mjs",

"**/drizzle.config.ts",
"**/runner.config.ts",
"**/vite.config.ts",
Expand All @@ -41,5 +48,5 @@ export default tsEslint.config(
...globals.browser,
},
},
}
);
},
);
13 changes: 6 additions & 7 deletions packages/eslint-config/rules/eslint.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export default [{
rules: {
/**
Expand All @@ -17,12 +16,12 @@ export default [{
"lines-between-class-members": "off",

"no-console": "warn",
"space-before-blocks": [ "error", {
"functions": "always",
"keywords": "always",
"classes": "always",
"space-before-blocks": ["error", {
functions: "always",
keywords: "always",
classes: "always",
}],
"keyword-spacing": [
"error", {"before": true},
"error", { before: true },
],
}}];
} }];
3 changes: 1 addition & 2 deletions packages/eslint-config/rules/esm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

export default [{
rules: {
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/no-require-imports": "error",
},
}];
}];
6 changes: 3 additions & 3 deletions packages/eslint-config/rules/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export default [
files: ["**/*.test.ts", "**/*.test.tsx"],
...jest.configs["flat/recommended"],
settings: {
"jest": {
"version": "latest",
jest: {
version: "latest",
},
},
rules: {
Expand All @@ -17,4 +17,4 @@ export default [
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error",
},
}];
}];
Loading

0 comments on commit 9dcf34c

Please sign in to comment.