Skip to content

Commit

Permalink
dev: updates devDependencies, migrates to eslint.config.js, fixes sec…
Browse files Browse the repository at this point in the history
…urity vulns
  • Loading branch information
webketje committed Nov 1, 2024
1 parent 18912c0 commit abe8a01
Show file tree
Hide file tree
Showing 6 changed files with 3,801 additions and 5,057 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions .eslintrc.yml

This file was deleted.

51 changes: 51 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import js from '@eslint/js'
import globals from 'globals'
import prettier from 'eslint-config-prettier'
import pluginImport from 'eslint-plugin-import'
import pluginNode from 'eslint-plugin-n'

const config = [
{
ignores: ['lib', 'test/index.cjs'],
languageOptions: {
globals: {
...globals.node
},

ecmaVersion: 2020,
sourceType: 'module'
},

rules: {
...js.configs.recommended.rules,
'no-console': 'error',
'prefer-const': 'error',
'no-var': 'error',
'no-use-before-define': 'error',
'no-await-in-loop': 'error',
'n/exports-style': [0, 'error'],
'import/first': 'error',
'import/no-anonymous-default-export': 'error',
'import/no-unassigned-import': 'error',
'import/no-internal-modules': [
'error',
{
allow: ['src/**']
}
]
},
plugins: {
import: pluginImport,
n: pluginNode,
prettier: prettier
}
},
{
files: ['test/{**/,}*.js'],
languageOptions: {
globals: { ...globals.mocha }
}
}
]

export default config
Loading

0 comments on commit abe8a01

Please sign in to comment.