added tons of features
This commit is contained in:
@@ -1,16 +1,63 @@
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
import {FlatCompat} from '@eslint/eslintrc'
|
||||
import {dirname} from 'path'
|
||||
import {fileURLToPath} from 'url'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
//import {plugins} from 'eslint-config-next'
|
||||
//const {plugins} = require('eslint-config-next')
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = dirname(__filename)
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
baseDirectory: __dirname
|
||||
})
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||
];
|
||||
...compat.extends(
|
||||
'next/core-web-vitals',
|
||||
'next/typescript',
|
||||
'plugin:prettier/recommended'
|
||||
),
|
||||
{
|
||||
plugins: ['validate-filename'],
|
||||
rules: {
|
||||
'validate-filename/naming-rules': [
|
||||
'error',
|
||||
{
|
||||
rules: [
|
||||
{
|
||||
case: 'kebab',
|
||||
target: '**/components/**',
|
||||
patterns: '^[a-z0-9-]+.tsx$'
|
||||
},
|
||||
{
|
||||
case: 'kebab',
|
||||
target: '**/app/**',
|
||||
patterns:
|
||||
'^(default|page|layout|loading|error|not-found|route|template).(tsx|ts)$'
|
||||
},
|
||||
{
|
||||
case: 'camel',
|
||||
target: '**/hooks/**',
|
||||
patterns: '^use'
|
||||
},
|
||||
{
|
||||
case: 'camel',
|
||||
target: '**/providers/**',
|
||||
patterns: '^[a-zA-Z]*Provider'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
'prettier/prettier': [
|
||||
'warn',
|
||||
{
|
||||
endOfLine: 'auto',
|
||||
semi: false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
export default eslintConfig;
|
||||
export default eslintConfig
|
||||
|
||||
Reference in New Issue
Block a user