@@ -2,6 +2,7 @@ import cspellPlugin from '@cspell/eslint-plugin';
22import eslint from '@eslint/js' ;
33// @ts -expect-error eslint-plugin-next doesn't come with TypeScript definitions
44import nextPlugin from '@next/eslint-plugin-next' ;
5+ import stylistic from '@stylistic/eslint-plugin' ;
56import eslintConfigPrettier from 'eslint-config-prettier' ;
67import react from 'eslint-plugin-react' ;
78import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort' ;
@@ -20,11 +21,12 @@ export default tsEslint.config(
2021 // register all of the plugins up-front
2122 {
2223 plugins : {
24+ '@cspell' : cspellPlugin ,
25+ '@stylistic' : stylistic ,
2326 'simple-import-sort' : simpleImportSortPlugin ,
2427 '@typescript-eslint' : tsEslint . plugin ,
2528 react,
2629 '@next/next' : nextPlugin ,
27- '@cspell' : cspellPlugin ,
2830 } ,
2931 } ,
3032 {
@@ -47,8 +49,28 @@ export default tsEslint.config(
4749 } ,
4850 } ,
4951 rules : {
50- ...nextPlugin . configs . recommended . rules ,
51- ...nextPlugin . configs [ 'core-web-vitals' ] . rules ,
52+ // spellchecker
53+ '@cspell/spellchecker' : [
54+ 'warn' ,
55+ {
56+ cspell : {
57+ language : 'en' ,
58+ dictionaries : [ 'typescript' , 'node' , 'html' , 'css' , 'bash' , 'npm' , 'pnpm' ] ,
59+ } ,
60+ } ,
61+ ] ,
62+ // stylistic
63+ '@stylistic/padding-line-between-statements' : [
64+ 'error' ,
65+ { blankLine : 'always' , prev : '*' , next : 'return' } ,
66+ { blankLine : 'always' , prev : 'directive' , next : '*' } ,
67+ { blankLine : 'any' , prev : 'directive' , next : 'directive' } ,
68+ {
69+ blankLine : 'always' ,
70+ prev : '*' ,
71+ next : [ 'enum' , 'interface' , 'type' ] ,
72+ } ,
73+ ] ,
5274 'arrow-body-style' : [ 'error' , 'as-needed' ] ,
5375 'no-empty-pattern' : 'warn' ,
5476 'no-console' : [ 'error' , { allow : [ 'warn' , 'error' , 'info' ] } ] ,
@@ -64,13 +86,13 @@ export default tsEslint.config(
6486 // simple-import-sort
6587 'simple-import-sort/exports' : 'error' ,
6688 'simple-import-sort/imports' : 'error' ,
67- // typescript
89+ // TypeScript
6890 '@typescript-eslint/no-unused-vars' : 'warn' ,
6991 '@typescript-eslint/no-explicit-any' : 'warn' ,
7092 '@typescript-eslint/no-empty-object-type' : 'off' ,
7193 '@typescript-eslint/no-unsafe-declaration-merging' : 'warn' ,
7294 '@typescript-eslint/consistent-type-definitions' : [ 'error' , 'interface' ] ,
73- // react
95+ // React
7496 'react/no-unescaped-entities' : 'off' ,
7597 'react/self-closing-comp' : [ 'error' , { component : true , html : true } ] ,
7698 'react/jsx-curly-brace-presence' : [ 'error' , { props : 'never' , children : 'never' } ] ,
@@ -83,18 +105,10 @@ export default tsEslint.config(
83105 noSortAlphabetically : true ,
84106 } ,
85107 ] ,
86- // next
108+ // Next.js
109+ ...nextPlugin . configs . recommended . rules ,
110+ ...nextPlugin . configs [ 'core-web-vitals' ] . rules ,
87111 '@next/next/no-sync-scripts' : 'warn' ,
88- // spellchecker
89- '@cspell/spellchecker' : [
90- 'warn' ,
91- {
92- cspell : {
93- language : 'en' ,
94- dictionaries : [ 'typescript' , 'node' , 'html' , 'css' , 'bash' , 'npm' , 'pnpm' ] ,
95- } ,
96- } ,
97- ] ,
98112 } ,
99113 } ,
100114 eslintConfigPrettier ,
0 commit comments