Skip to content

Commit

Permalink
update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Nov 2, 2024
1 parent ed8341e commit 7a15c55
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 93 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, 2],
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',
},
}]
33 changes: 17 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
"@typescript-eslint/parser": "^8.12.2",
"@vitest/coverage-v8": "^2.1.4",
"eslint": "^9.14.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-unicorn": "^56.0.0",
"geckodriver": ".",
"globals": "^15.11.0",
"husky": "^9.1.6",
"npm-run-all2": "^7.0.1",
"octokit": "^4.0.2",
Expand Down
1 change: 0 additions & 1 deletion tests/interop/cjs.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { test, expect } from 'vitest'

// eslint-disable-next-line import/extensions
const { start, download } = require('../..')

test('should work in CJS context', () => {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"root":["./src/cli.ts","./src/constants.ts","./src/index.ts","./src/install.ts","./src/types.ts","./src/utils.ts","./src/cjs/index.ts","./src/cjs/package.json"],"version":"5.6.3"}

0 comments on commit 7a15c55

Please sign in to comment.