-
Notifications
You must be signed in to change notification settings - Fork 12
chore(eslint): enforce kebab-case filenames, purge convention prose #1747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
902bb1f
29e9691
84fa531
99443ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,12 +17,16 @@ module.exports = { | |
| sourceType: 'module', | ||
| project: ['./tsconfig.eslint.json'], | ||
| }, | ||
| plugins: ['@typescript-eslint', 'prettier', 'jest', 'jest-formatting'], | ||
| plugins: ['@typescript-eslint', 'prettier', 'jest', 'jest-formatting', 'unicorn'], | ||
| rules: { | ||
| /**********/ | ||
| /** Style */ | ||
| /**********/ | ||
|
|
||
| // Kebab-case filenames avoid case-sensitivity mismatches between macOS and Linux CI. | ||
| // Generated parser, snake-case demo fixtures, and _-grouped tests are relaxed below. | ||
| 'unicorn/filename-case': ['error', { case: 'kebabCase' }], | ||
|
|
||
| // Code spacing | ||
| 'prettier/prettier': 'error', | ||
| 'arrow-parens': ['error', 'as-needed'], | ||
|
|
@@ -144,5 +148,20 @@ module.exports = { | |
| ], | ||
| }, | ||
| }, | ||
| { | ||
| // Generated ANTLR parser: cannot rename without breaking regeneration. | ||
| files: ['**/generated-parser/**/*'], | ||
| rules: { 'unicorn/filename-case': 'off' }, | ||
| }, | ||
| { | ||
| // Demo fixtures mirror snake_case database table names. | ||
| files: ['packages/datasource-demo-fintech/**/*'], | ||
| rules: { 'unicorn/filename-case': 'off' }, | ||
| }, | ||
| { | ||
| // Tests use _-grouped filenames. | ||
| files: ['**/test/**/*'], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: disabling kebab-case for every |
||
| rules: { 'unicorn/filename-case': 'off' }, | ||
| }, | ||
| ], | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
| "eslint-plugin-jest": "^27.2.1", | ||
| "eslint-plugin-jest-formatting": "^3.1.0", | ||
| "eslint-plugin-prettier": "^4.2.1", | ||
| "eslint-plugin-unicorn": "^48.0.1", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: unicorn@48 requires eslint >=8.44 while the repo declares |
||
| "fishery": "^2.2.2", | ||
| "husky": "^8.0.3", | ||
| "jest": "^29.3.1", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: this exempts the entire
datasource-demo-fintechpackage, but only the 5 snake_case files undersrc/customizations/**actually violate the rule — scope topackages/datasource-demo-fintech/src/customizations/**/*so future files stay checked.