Skip to content

Commit

Permalink
chore: cleanup eslint config (#2943)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade authored Jan 3, 2025
1 parent 84f9983 commit ccba5eb
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 89 deletions.
40 changes: 16 additions & 24 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import path from 'node:path';
import {fileURLToPath} from 'node:url';

import {fixupConfigRules, fixupPluginRules} from '@eslint/compat';
import {FlatCompat} from '@eslint/eslintrc';
import js from '@eslint/js';
import eslint from '@eslint/js';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import _import from 'eslint-plugin-import';
import mocha from 'eslint-plugin-mocha';
import promise from 'eslint-plugin-promise';
import importPlugin from 'eslint-plugin-import';
import mochaPlugin from 'eslint-plugin-mocha';
import eslintPrettierPluginRecommended from 'eslint-plugin-prettier/recommended';
import promisePlugin from 'eslint-plugin-promise';
import globals from 'globals';

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,
baseDirectory: import.meta.dirname,
recommendedConfig: eslint.configs.recommended,
allConfig: eslint.configs.all,
});

/**
Expand Down Expand Up @@ -61,22 +57,18 @@ export default [
'src/protocol-parser/generated/',
],
},
...fixupConfigRules(
compat.extends(
'eslint:recommended',
'plugin:import/typescript',
'plugin:mocha/recommended',
'plugin:prettier/recommended',
'plugin:promise/recommended',
),
),
eslint.configs.recommended,
eslintPrettierPluginRecommended,
importPlugin.flatConfigs.typescript,
mochaPlugin.configs.flat.recommended,
promisePlugin.configs['flat/recommended'],
{
name: 'JavaScript rules',

plugins: {
import: fixupPluginRules(_import),
mocha: fixupPluginRules(mocha),
promise: fixupPluginRules(promise),
import: importPlugin,
mocha: mochaPlugin,
promise: promisePlugin,
},

languageOptions: {
Expand Down
114 changes: 50 additions & 64 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@
},
"devDependencies": {
"@actions/core": "1.11.1",
"@eslint/compat": "1.2.4",
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.17.0",
"@puppeteer/browsers": "2.6.1",
Expand Down

0 comments on commit ccba5eb

Please sign in to comment.