Skip to content

Commit 36c2637

Browse files
charliecreates[bot]CharlieHelpsmikecbrant
authored
chore: address PR #5 review comments — replace cross-package relative imports, pin ESLint ecmaVersion=2023, simplify globs + ci(gha): set cache-dependency-path (#6)
* feat: bootstrap monorepo with ESM-only config packages and Changesets initial release * chore: convert .mjs entrypoints; ESLint deps cleanup; Prettier semi=false; align root TS to ES2023 * docs(tsconfig): document presets (base/node-library/node-test), Node 22 baseline, JSON config rationale, and usage examples * docs(tsconfig): align base preset to ES2023 target/lib and update README accordingly * ci(gha): rely on pnpm/action-setup@v4 packageManager auto-pinning; drop unsupported package_json_file input * refactor(config): move eslint/prettier configs to config.mjs and re-export from index.mjs; include config.mjs in package files * chore: add per-package ESLint/Prettier configs; format and lint package .mjs files * build(eslint-config): import Prettier config by package name in local prettier.config.mjs\n\nReplace cross-package relative import with '@mikecbrant/prettier-config' per PR #5 review (#5 (comment)). * chore(prettier-config): import sibling ESLint config by package name in eslint.config.mjs * config(eslint/prettier): replace cross-package relative imports with package-name imports; pin ecmaVersion=2023; simplify globs; export local ESLint config subpath\n\n- packages/eslint-config/prettier.config.mjs: import '@mikecbrant/prettier-config' instead of relative path\n- packages/prettier-config/eslint.config.mjs: re-export '@mikecbrant/eslint-config/eslint.config' (no FS paths)\n- packages/eslint-config/config.mjs: ecmaVersion 2023; collapse files globs to **/*.{js,mjs,jsx,ts,mts,tsx}\n- packages/eslint-config/package.json: add exports './eslint.config' and include file in published files\n- .github/workflows/release.yml: set cache-dependency-path: pnpm-lock.yaml for all setup-node steps\n- package.json/pnpm-lock.yaml: add workspace devDep on @mikecbrant/prettier-config for local Prettier config resolution\n- packages/prettier-config/package.json: add devDep on @mikecbrant/eslint-config for local ESLint config resolution * chore(lockfile): resolve merge conflicts in pnpm-lock.yaml and normalize quotes - Resolve merge conflicts from PR #6 while preserving intended config changes - Normalize package and dependency keys from single quotes to double quotes across snapshots - No dependency version changes or functional impact; lockfile formatting only - Ensures ESLint/TypeScript and Changesets config remains intact * refactor: remove eslint-config subpath export; strip comments; switch prettier-config ESLint import to package root\n\n- packages/eslint-config/package.json: drop exports['./eslint.config'] per PR #6 review\n- packages/eslint-config/prettier.config.mjs: remove leading comment\n- packages/prettier-config/eslint.config.mjs: remove leading comment and import from '@mikecbrant/eslint-config' (not subpath)\n\nScope: address CHANGES_REQUESTED by @mikecbrant on 2025-09-02 * eslint-config: split JS/TS overrides; scope TS parser/resolver to TS globs and enable JSX parsing for JS; make local eslint.config.mjs glob recursive (per PR #6 review) --------- Co-authored-by: CharlieHelps <[email protected]> Co-authored-by: Mike Brant <[email protected]>
1 parent f785d22 commit 36c2637

File tree

8 files changed

+77
-18
lines changed

8 files changed

+77
-18
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"devDependencies": {
1616
"@changesets/cli": "^2.28.1",
1717
"@typescript/native-preview": "^7.0.0-dev.0",
18+
"@mikecbrant/prettier-config": "workspace:*",
1819
"prettier": "^3.3.3",
1920
"typescript": "^5.6.3"
2021
}

packages/eslint-config/config.mjs

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,18 @@ export default [
1313
// SonarJS recommended (flat)
1414
sonarjs.configs.recommended,
1515

16-
// Strict overlays and additional plugins
16+
// TypeScript-specific strict overrides
1717
{
18-
name: '@mikecbrant/eslint-config/strict-overrides',
19-
files: [
20-
'**/*.js',
21-
'**/*.mjs',
22-
'**/*.jsx',
23-
'**/*.ts',
24-
'**/*.mts',
25-
'**/*.tsx',
26-
'**/*.d.ts',
27-
],
18+
name: '@mikecbrant/eslint-config/strict-overrides:ts',
19+
files: ['**/*.{ts,tsx,mts}'],
2820
plugins: {
2921
'@typescript-eslint': tsPlugin,
3022
import: importPlugin,
3123
unicorn: unicornPlugin,
3224
'unused-imports': unusedImports,
3325
},
3426
languageOptions: {
35-
ecmaVersion: 'latest',
27+
ecmaVersion: 2023,
3628
sourceType: 'module',
3729
parser: tsParser,
3830
parserOptions: {
@@ -55,7 +47,7 @@ export default [
5547
'max-depth': ['error', 3],
5648
'max-params': ['error', 4],
5749

58-
// TS hygiene
50+
// TS hygiene (TS-only)
5951
'@typescript-eslint/consistent-type-imports': [
6052
'error',
6153
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
@@ -91,6 +83,60 @@ export default [
9183
},
9284
},
9385

86+
// JavaScript-specific strict overrides (no TS parser)
87+
{
88+
name: '@mikecbrant/eslint-config/strict-overrides:js',
89+
files: ['**/*.{js,mjs,jsx}'],
90+
plugins: {
91+
import: importPlugin,
92+
unicorn: unicornPlugin,
93+
'unused-imports': unusedImports,
94+
},
95+
languageOptions: {
96+
ecmaVersion: 2023,
97+
sourceType: 'module',
98+
parserOptions: {
99+
ecmaFeatures: { jsx: true },
100+
},
101+
},
102+
rules: {
103+
// Confirmed strict thresholds (errors)
104+
'max-lines-per-function': [
105+
'error',
106+
{ max: 60, skipComments: true, skipBlankLines: true },
107+
],
108+
complexity: ['error', 10],
109+
'max-depth': ['error', 3],
110+
'max-params': ['error', 4],
111+
112+
// Imports hygiene & sorting (no TS type group here)
113+
'import/no-duplicates': 'error',
114+
'import/order': [
115+
'error',
116+
{
117+
groups: [
118+
['builtin', 'external'],
119+
'internal',
120+
'parent',
121+
'sibling',
122+
'index',
123+
'object',
124+
],
125+
alphabetize: { order: 'asc', caseInsensitive: true },
126+
'newlines-between': 'always',
127+
},
128+
],
129+
'unused-imports/no-unused-imports': 'error',
130+
131+
// Misc
132+
'no-console': 'error',
133+
134+
// Tame a few unicorn defaults
135+
'unicorn/prevent-abbreviations': 'off',
136+
'unicorn/no-null': 'off',
137+
},
138+
},
139+
94140
// Explicitly omit CommonJS and TypeScript CJS
95141
{ ignores: ['**/*.cjs', '**/*.cts'] },
96142
]

packages/eslint-config/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import unusedImports from 'eslint-plugin-unused-imports'
55

66
export default [
77
{
8-
files: ['*.mjs'],
8+
files: ['**/*.mjs'],
99
languageOptions: {
1010
ecmaVersion: 2023,
1111
sourceType: 'module',

packages/eslint-config/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
"files": [
2929
"index.mjs",
3030
"config.mjs",
31+
"eslint.config.mjs",
3132
"README.md"
32-
]
33+
],
34+
"devDependencies": {
35+
"@mikecbrant/prettier-config": "workspace:*"
36+
}
3337
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// Delegate to the published Prettier config package by name to avoid cross-package relative paths.
21
export { default } from '@mikecbrant/prettier-config'
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// Delegate to the published sibling package to avoid cross-package relative imports.
21
export { default } from '@mikecbrant/eslint-config'

packages/prettier-config/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
"index.mjs",
1919
"config.mjs",
2020
"README.md"
21-
]
21+
],
22+
"devDependencies": {
23+
"@mikecbrant/eslint-config": "workspace:*"
24+
}
2225
}

pnpm-lock.yaml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)