Skip to content

Commit

Permalink
chore: add eslint-plugin-n to ESLint rules (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
shinGangan authored Jun 24, 2024
1 parent e628945 commit f9b4140
Show file tree
Hide file tree
Showing 3 changed files with 235 additions and 169 deletions.
24 changes: 19 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @ts-check
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
import pluginNode from 'eslint-plugin-n'

export default createConfigForNuxt({
features: {
Expand All @@ -10,11 +11,6 @@ export default createConfigForNuxt({
src: ['./src', './client', './docs'],
},
})
.override('nuxt/javascript', {
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
},
})
.override('nuxt/typescript/rules', {
rules: {
'@typescript-eslint/ban-ts-comment': [
Expand All @@ -41,3 +37,21 @@ export default createConfigForNuxt({
'vue/max-attributes-per-line': 'off',
},
})
.append({
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
},
})
.append({
plugins: {
node: pluginNode,
},
rules: {
'node/handle-callback-err': ['error', '^(err|error)$'],
'node/no-deprecated-api': 'error',
'node/no-exports-assign': 'error',
'node/no-new-require': 'error',
'node/no-path-concat': 'error',
'node/process-exit-as-throw': 'error',
},
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
"acorn-loose": "^8.4.0",
"bumpp": "^9.4.1",
"changelogen": "^0.5.5",
"eslint": "9.4.0",
"eslint": "9.5.0",
"eslint-plugin-n": "^17.9.0",
"knitwork": "^1.1.0",
"nuxt": "^3.12.1",
"playwright-core": "^1.44.1",
Expand Down
Loading

0 comments on commit f9b4140

Please sign in to comment.