Skip to content

Commit

Permalink
(chore): fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LoboMetalurgico committed Feb 24, 2025
1 parent 6aad063 commit 4fe74a1
Show file tree
Hide file tree
Showing 12 changed files with 2,845 additions and 1,822 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

102 changes: 0 additions & 102 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node v16
- name: Install Node v22
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 22
- name: Install dependencies
run: npm ci
- name: Run ESLint
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
node-version: [16, 18, 20, 22]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
Expand Down
120 changes: 120 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [{
ignores: ['build/**/*', 'tests/**/*'],
}, ...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
), {
plugins: {
'@typescript-eslint': typescriptEslint,
},

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

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

rules: {
'@typescript-eslint/ban-ts-ignore': ['off'],
'@typescript-eslint/explicit-function-return-type': ['error'],
'@typescript-eslint/interface-name-prefix': ['off'],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/no-unused-expressions': ['error'],
'@typescript-eslint/no-var-requires': ['off'],
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-non-null-assertion': ['off'],
'array-bracket-spacing': ['warn', 'never'],
capIsNew: ['off'],
'comma-dangle': ['error', 'always-multiline'],
'computed-property-spacing': 'warn',

'default-case': ['error', {
commentPattern: '^no default$',
}],

'eol-last': ['error', 'always'],

indent: ['warn', 2, {
SwitchCase: 1,
}],

'keyword-spacing': ['warn', {
before: true,
after: true,
}],

'linebreak-style': ['error', 'unix'],

'max-len': ['warn', {
code: 250,
ignoreComments: true,
ignoreUrls: true,
}],

'new-cap': 0,
'no-async-promise-executor': ['off'],
'no-await-in-loop': 'warn',
'no-caller': 2,
'no-compare-neg-zero': 'error',
'no-cond-assign': [2, 'except-parens'],
'no-empty-pattern': ['off'],
'no-template-curly-in-string': 'error',
'no-unsafe-negation': 'error',
'no-undef': ['error'],
'no-unused-vars': 'off',

'no-empty': ['error', {
allowEmptyCatch: true,
}],

'no-console': 'off',
'no-multi-spaces': 'warn',

'no-use-before-define': [2, {
functions: false,
classes: false,
variables: false,
}],

'no-var': ['off'],
'no-prototype-builtins': ['off'],
'object-curly-spacing': ['error', 'always'],

'prefer-const': ['warn', {
destructuring: 'all',
}],

quotes: ['error', 'single', {
allowTemplateLiterals: true,
}],

strict: ['error', 'global'],
semi: ['error', 'always'],
'spaced-comment': ['warn', 'always'],
'sort-keys': ['off'],
'space-before-function-paren': ['off'],
'space-infix-ops': 'warn',
},
}];
Loading

0 comments on commit 4fe74a1

Please sign in to comment.