setup husky prettier eslint
This commit is contained in:
36
eslint.config.js
Normal file
36
eslint.config.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import nextConfig from 'eslint-config-next';
|
||||
import prettierPlugin from 'eslint-plugin-prettier';
|
||||
|
||||
const prettierRules = {
|
||||
'prettier/prettier': [
|
||||
'error',
|
||||
{
|
||||
singleQuote: true,
|
||||
trailingComma: 'all',
|
||||
printWidth: 100,
|
||||
endOfLine: 'auto',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const additionalRules = {
|
||||
...prettierRules,
|
||||
// Some React rules are intentionally relaxed for this project.
|
||||
'react-hooks/set-state-in-effect': 'off',
|
||||
'react-hooks/exhaustive-deps': 'warn',
|
||||
'react-hooks/immutability': 'off',
|
||||
'react-hooks/incompatible-library': 'off',
|
||||
'react-hooks/purity': 'off',
|
||||
'import/no-anonymous-default-export': 'off',
|
||||
};
|
||||
|
||||
export default [
|
||||
...nextConfig,
|
||||
{
|
||||
files: ['**/*.{js,jsx,ts,tsx}'],
|
||||
plugins: {
|
||||
prettier: prettierPlugin,
|
||||
},
|
||||
rules: additionalRules,
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user