-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support Next.js pages router naming case for file name #43
Comments
I think |
Nirajn2311
changed the title
Support Next.js app router naming case for file name
Support Next.js pages router naming case for file name
May 30, 2024
My bad, I was thinking of the pages router and got them muddled up when creating the issue. |
here's how I got it to work with pages router. It skips the dynamic files: {
"extends": [
"next/core-web-vitals",
"next",
"prettier",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended"
],
"plugins": ["check-file"],
"rules": {
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/ban-ts-comment": ["off"],
"@typescript-eslint/no-explicit-any": ["warn"],
"check-file/filename-naming-convention": [
"error",
{
"**/use*.{ts,tsx}": "CAMEL_CASE",
"**/*Provider.{ts,tsx}": "CAMEL_CASE",
"**/pages/**/!(\\[*\\]).{ts,tsx}": "KEBAB_CASE",
"**/!(\\[*\\]|use*).{ts,tsx}": "KEBAB_CASE"
},
{
// ignore the middle extensions of the filename to support filename like bable.config.js or smoke.spec.ts
"ignoreMiddleExtensions": true
}
],
"check-file/folder-naming-convention": [
"error",
{
// all folders within src (except __tests__)should be named in kebab-case
"src/**/!(__tests__)": "KEBAB_CASE"
}
]
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently folder names are checked with the
NEXT_JS_APP_ROUTER_CASE
value to be in line with Next.js app routers naming conventions. Similarly can it also be added to the file naming convention rule as those also need to be inline with the same naming Next.js conventions but for pages routerThe text was updated successfully, but these errors were encountered: