Skip to content

Commit ffc8253

Browse files
committed
added global ignores
1 parent f139569 commit ffc8253

9 files changed

Lines changed: 174 additions & 98 deletions

File tree

packages/server/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## [2.0.0] - 2026-03-19
7+
8+
### Changed
9+
- ESLint config now exported as an array to support global `ignores`
10+
11+
[2.0.0]: https://github.com/hystax/eslint-config-hystax/tree/packages/server/v2.0.0
12+
13+
614
## [1.0.0] - 2026-02-20
715

816
### Added
917
- Initial release of `@hystax/eslint-config-server`
1018
- Includes base ESLint rules for Server projects (Node.js, TypeScript, Prettier, etc.)
1119

12-
[1.0.0]: https://github.com/hystax/eslint-config-hystax/tree/20260220-01/packages/server
20+
[1.0.0]: https://github.com/hystax/eslint-config-hystax/tree/packages/server/v1.0.0

packages/server/index.mjs

Lines changed: 51 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,63 @@ import nodeRules from "./rules/node.mjs";
1111
import importsRules from "./rules/imports.mjs";
1212
import prettierRules from "./rules/prettier.mjs";
1313

14-
export default {
15-
ignores: ["**/node_modules/**", "**/dist/**", "**/build/**", "**/.next/**"],
16-
17-
files: ["**/*.ts"],
18-
19-
plugins: {
20-
node: nodePlugin,
21-
import: eslintPluginImport,
22-
"unused-imports": unusedImportsPlugin,
23-
"@typescript-eslint": typescriptPlugin,
24-
prettier: eslintPluginPrettier,
14+
export default [
15+
{
16+
ignores: [
17+
"**/node_modules/**",
18+
"**/dist/**",
19+
"**/build/**",
20+
"**/.next/**",
21+
"**/.out/**",
22+
"**/.turbo/**",
23+
"**/.cache/**",
24+
"**/.parcel-cache/**",
25+
"**/.vite/**",
26+
"**/coverage/**",
27+
"**/tmp/**",
28+
"**/temp/**",
29+
],
2530
},
31+
{
32+
files: ["**/*.ts"],
2633

27-
languageOptions: {
28-
parser: typescriptParser,
29-
parserOptions: {
30-
ecmaVersion: "latest",
31-
sourceType: "module",
34+
plugins: {
35+
node: nodePlugin,
36+
import: eslintPluginImport,
37+
"unused-imports": unusedImportsPlugin,
38+
"@typescript-eslint": typescriptPlugin,
39+
prettier: eslintPluginPrettier,
3240
},
33-
globals: {
34-
...globals.node,
35-
...globals.builtin,
36-
...globals.jest,
37-
vi: true,
41+
42+
languageOptions: {
43+
parser: typescriptParser,
44+
parserOptions: {
45+
ecmaVersion: "latest",
46+
sourceType: "module",
47+
},
48+
globals: {
49+
...globals.node,
50+
...globals.builtin,
51+
...globals.jest,
52+
vi: true,
53+
},
3854
},
39-
},
4055

41-
settings: {
42-
"import/resolver": {
43-
node: {
44-
extensions: [".js", ".cjs", ".mjs", ".ts"],
45-
moduleDirectory: ["node_modules", "src/"],
56+
settings: {
57+
"import/resolver": {
58+
node: {
59+
extensions: [".js", ".cjs", ".mjs", ".ts"],
60+
moduleDirectory: ["node_modules", "src/"],
61+
},
4662
},
63+
"import/ignore": ["node_modules"],
4764
},
48-
"import/ignore": ["node_modules"],
49-
},
5065

51-
rules: {
52-
...baseRules,
53-
...nodeRules,
54-
...importsRules,
55-
...prettierRules,
66+
rules: {
67+
...baseRules,
68+
...nodeRules,
69+
...importsRules,
70+
...prettierRules,
71+
},
5672
},
57-
};
73+
];

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hystax/eslint-config-server",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Server ESLint config for Hystax projects",
55
"main": "index.mjs",
66
"type": "module",

packages/server/test.mjs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,34 @@ const files = [
1919

2020
if (file === "./index.mjs") {
2121
const config = module.default;
22-
if (!config || typeof config !== "object") {
23-
throw new Error("config export is missing or not an object");
22+
if (!Array.isArray(config)) {
23+
throw new Error(
24+
"index.mjs export should be an array (config array is missing or invalid)"
25+
);
2426
}
25-
if (!config.rules || typeof config.rules !== "object") {
26-
throw new Error("config.rules is missing or invalid");
27+
28+
for (const [i, item] of config.entries()) {
29+
if (!item || typeof item !== "object") {
30+
throw new Error(
31+
`index.mjs array element at position ${i} is not an object`
32+
);
33+
}
34+
}
35+
36+
const hasRules = config.some(
37+
(item) => item.rules && typeof item.rules === "object"
38+
);
39+
if (!hasRules) {
40+
throw new Error(
41+
"index.mjs array must contain at least one object with rules"
42+
);
2743
}
2844
}
2945
})
3046
);
3147

3248
console.log(
33-
"✅ All ESLint config files loaded successfully and are valid objects."
49+
"✅ All ESLint config files loaded successfully and are valid."
3450
);
3551
} catch (err) {
3652
console.error("❌ Failed to load config:", err);

packages/ui/CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## [2.0.0] - 2026-03-19
7+
8+
### Changed
9+
- ESLint config now exported as an array to support global `ignores`
10+
- Added new React rule: `react/jsx-curly-brace-presence` with `props: "never", children: "never"`
11+
12+
[2.0.0]: https://github.com/hystax/eslint-config-hystax/tree/packages/ui/v2.0.0
13+
14+
615
## [1.0.0] - 2025-11-03
716

817
### Added
918
- Initial release of `@hystax/eslint-config-ui`
1019
- Includes base ESLint rules for UI projects (React, JSX, TypeScript, Prettier, etc.)
1120

12-
[1.0.0]: https://github.com/hystax/eslint-config-hystax/tree/20251103-01/packages/ui
21+
[1.0.0]: https://github.com/hystax/eslint-config-hystax/tree/packages/ui/v1.0.0

packages/ui/index.mjs

Lines changed: 59 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,70 @@ import reactRules from "./rules/react.mjs";
1212
import importsRules from "./rules/imports.mjs";
1313
import prettierRules from "./rules/prettier.mjs";
1414

15-
export default {
16-
ignores: [
17-
"**/node_modules/**",
18-
"**/dist/**",
19-
"**/build/**",
20-
"**/.next/**",
21-
"**/stories/**",
22-
"**/*.stories.*"
23-
],
24-
25-
files: ["src/**/*.{ts,tsx}"],
26-
27-
plugins: {
28-
react: reactPlugin,
29-
"react-hooks": reactHooksPlugin,
30-
"@typescript-eslint": typescriptPlugin,
31-
import: eslintPluginImport,
32-
"unused-imports": unusedImportsPlugin,
33-
prettier: eslintPluginPrettier
15+
export default [
16+
{
17+
ignores: [
18+
"**/node_modules/**",
19+
"**/dist/**",
20+
"**/build/**",
21+
"**/.next/**",
22+
"**/.out/**",
23+
"**/.turbo/**",
24+
"**/.cache/**",
25+
"**/.parcel-cache/**",
26+
"**/.vite/**",
27+
"**/coverage/**",
28+
"**/tmp/**",
29+
"**/temp/**",
30+
"**/stories/**",
31+
"**/*.stories.*",
32+
],
3433
},
34+
{
35+
files: ["src/**/*.{ts,tsx}"],
3536

36-
languageOptions: {
37-
parser: tsParser,
38-
parserOptions: {
39-
ecmaVersion: "latest",
40-
sourceType: "module",
41-
ecmaFeatures: {
42-
jsx: true,
43-
},
37+
plugins: {
38+
react: reactPlugin,
39+
"react-hooks": reactHooksPlugin,
40+
"@typescript-eslint": typescriptPlugin,
41+
import: eslintPluginImport,
42+
"unused-imports": unusedImportsPlugin,
43+
prettier: eslintPluginPrettier,
4444
},
45-
globals: {
46-
...globals.browser,
47-
...globals.builtin,
48-
...globals.jest,
49-
vi: true
50-
}
51-
},
5245

53-
settings: {
54-
react: { version: "detect" },
55-
"import/resolver": {
56-
node: {
57-
extensions: [".js", ".jsx", ".ts", ".tsx"],
58-
moduleDirectory: ["node_modules", "src/"]
46+
languageOptions: {
47+
parser: tsParser,
48+
parserOptions: {
49+
ecmaVersion: "latest",
50+
sourceType: "module",
51+
ecmaFeatures: {
52+
jsx: true,
53+
},
54+
},
55+
globals: {
56+
...globals.browser,
57+
...globals.builtin,
58+
...globals.jest,
59+
vi: true,
5960
},
6061
},
61-
"import/ignore": ["node_modules"]
62-
},
6362

64-
rules: {
65-
...baseRules,
66-
...reactRules,
67-
...importsRules,
68-
...prettierRules,
69-
}
70-
};
63+
settings: {
64+
react: { version: "detect" },
65+
"import/resolver": {
66+
node: {
67+
extensions: [".js", ".jsx", ".ts", ".tsx"],
68+
moduleDirectory: ["node_modules", "src/"],
69+
},
70+
},
71+
"import/ignore": ["node_modules"],
72+
},
7173

74+
rules: {
75+
...baseRules,
76+
...reactRules,
77+
...importsRules,
78+
...prettierRules,
79+
},
80+
},
81+
];

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hystax/eslint-config-ui",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "UI ESLint config for Hystax projects",
55
"main": "index.mjs",
66
"type": "module",

packages/ui/rules/react.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ export default {
2121
"react/display-name": "off",
2222
"react/react-in-jsx-scope": "off",
2323
"react/prop-types": "off",
24+
"react/jsx-curly-brace-presence": ["error", { props: "never", children: "never" }]
2425
}

packages/ui/test.mjs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,33 @@ const files = [
1919

2020
if (file === "./index.mjs") {
2121
const config = module.default;
22-
if (!config || typeof config !== "object") {
23-
throw new Error("config export is missing or not an object");
22+
if (!Array.isArray(config)) {
23+
throw new Error(
24+
"index.mjs export should be an array (config array is missing or invalid)"
25+
);
2426
}
25-
if (!config.rules || typeof config.rules !== "object") {
26-
throw new Error("config.rules is missing or invalid");
27+
28+
for (const [i, item] of config.entries()) {
29+
if (!item || typeof item !== "object") {
30+
throw new Error(
31+
`index.mjs array element at position ${i} is not an object`
32+
);
33+
}
34+
}
35+
36+
const hasRules = config.some(
37+
(item) => item.rules && typeof item.rules === "object"
38+
);
39+
if (!hasRules) {
40+
throw new Error(
41+
"index.mjs array must contain at least one object with rules"
42+
);
2743
}
2844
}
2945
})
3046
);
3147

32-
console.log("✅ All ESLint config files loaded successfully and are valid objects.");
48+
console.log("✅ All ESLint config files loaded successfully and are valid.");
3349
} catch (err) {
3450
console.error("❌ Failed to load config:", err);
3551
process.exit(1);

0 commit comments

Comments
 (0)