Skip to content

Commit

Permalink
internal: adopt new internal eslint package
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Nov 18, 2024
1 parent 7450627 commit ed8eb69
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 126 deletions.
98 changes: 14 additions & 84 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,87 +1,17 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import unicorn from 'eslint-plugin-unicorn'
import globals from 'globals'
import tsParser from '@typescript-eslint/parser'
import wdioEslint from '@wdio/eslint'

export default [{
files: ['**/*.ts'],
plugins: {
'@typescript-eslint': typescriptEslint,
unicorn,
export default wdioEslint.config([
{
ignores: ['dist', 'example']
},
ignores: [
'node_modules/**',
'dist/**',
'build/**',
'example/.nuxt/**',
'example/.output/**',
],

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-unused-vars': 'off',
'no-undef': 'off',
'no-redeclare': 'off',
'dot-notation': 'off',

'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',
/**
* custom test configuration
*/
{
files: ['src/cjs/**/*'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
}
}]
])
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,15 @@
"release:minor": "npm run release -- minor",
"release:major": "npm run release -- major",
"test": "run-s test:*",
"test:lint": "eslint",
"test:lint": "eslint .",
"test:e2e": "cd example && npx wdio run ./wdio.conf.ts",
"watch": "npm run build -- --watch"
},
"devDependencies": {
"@types/mocha": "^10.0.9",
"@types/node": "^20.14.8",
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"@wdio/eslint": "^0.0.3",
"eslint": "^9.14.0",
"eslint-plugin-unicorn": "^56.0.0",
"eslint-plugin-wdio": "^9.0.8",
"globals": "^15.11.0",
"husky": "^9.1.6",
"npm-run-all2": "^7.0.1",
"release-it": "^17.10.0",
Expand Down
Loading

0 comments on commit ed8eb69

Please sign in to comment.