Skip to content

Commit

Permalink
migrate to Eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Nov 2, 2024
1 parent cea21cf commit 60cc467
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 76 deletions.
75 changes: 0 additions & 75 deletions .eslintrc.cjs

This file was deleted.

85 changes: 85 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import unicorn from 'eslint-plugin-unicorn'
import globals from 'globals'
import tsParser from '@typescript-eslint/parser'

export default [{
plugins: {
'@typescript-eslint': typescriptEslint,
unicorn,
},
ignores: ['node_modules/**', 'dist/**', 'build/**'],

languageOptions: {
globals: {
...globals.node,
},

parser: tsParser,
ecmaVersion: 2020,
sourceType: 'module',
},

rules: {
quotes: ['error', 'single', {
avoidEscape: true,
}],

camelcase: ['error', {
properties: 'never',
}],

semi: ['error', 'never'],
indent: [2, 4],
eqeqeq: ['error', 'always'],
'prefer-const': 'error',

'no-multiple-empty-lines': [2, {
max: 1,
maxEOF: 1,
}],

'array-bracket-spacing': ['error', 'never'],

'brace-style': ['error', '1tbs', {
allowSingleLine: true,
}],

'comma-spacing': ['error', {
before: false,
after: true,
}],

'no-lonely-if': 'error',
'dot-notation': 'error',
'no-else-return': 'error',
'no-tabs': 'error',

'no-trailing-spaces': ['error', {
skipBlankLines: false,
ignoreComments: false,
}],

'no-var': 'error',
'unicode-bom': ['error', 'never'],
curly: ['error', 'all'],
'object-curly-spacing': ['error', 'always'],
'keyword-spacing': ['error'],
'require-atomic-updates': 0,
'linebreak-style': ['error', 'unix'],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'unicorn/prefer-node-protocol': ['error'],
'no-restricted-syntax': ['error', 'IfStatement > ExpressionStatement > AssignmentExpression'],
'unicorn/prefer-ternary': 'error',
},
}, {
files: ['**/*.ts'],
ignores: ['node_modules/**', 'dist/**', 'build/**'],
rules: {
'no-unused-vars': 'off',
'no-undef': 'off',
'no-redeclare': 'off',
'dot-notation': 'off',
},
}]
1 change: 0 additions & 1 deletion tests/interop/cjs.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const assert = require('node:assert')
// eslint-disable-next-line
const driver = require('../..')

console.log('Start CJS tests')
Expand Down

0 comments on commit 60cc467

Please sign in to comment.