Skip to content

Commit

Permalink
Migrate to eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentiumYT committed Sep 4, 2024
1 parent 8287c33 commit 0c22d9a
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 145 deletions.
14 changes: 0 additions & 14 deletions .eslintignore

This file was deleted.

31 changes: 0 additions & 31 deletions .eslintrc.js

This file was deleted.

70 changes: 70 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import simpleImportSort from 'eslint-plugin-simple-import-sort';
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: [
'**/node_modules/',
'**/lib/',
'**/tmp/',
'test/*.js',
'**/templates/',
'**/@types/',
'**/*.js',
'*/*.js',
],
},
...compat.extends('plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'),
{
plugins: {
'simple-import-sort': simpleImportSort,
},

languageOptions: {
parser: tsParser,
},

rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',

quotes: [
2,
'single',
{
avoidEscape: true,
},
],

'no-debugger': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-misused-new': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/triple-slash-reference': 'off',

'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],

camelcase: 'off',
'@typescript-eslint/camelcase': 'off',
},
},
];
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build:package": "yarn run build && rm -rf './dist/[email protected]' && cd ./dist && zip -qr '[email protected]' .",
"watch": "yarn run build && yarn run rollup -c --watch",
"test": "jasmine --module --no-config build/tests/",
"lint": "eslint --ext .ts src/",
"lint": "eslint src/",
"shell:restart": "busctl --user call org.gnome.Shell /io/elhan/Pano io.elhan.Pano restart",
"build-and-restart": "yarn run build && yarn run shell:restart",
"prettier:check": "prettier --check .",
Expand All @@ -36,6 +36,8 @@
"devDependencies": {
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.1",
"@girs/adw-1": "1.6.0-4.0.0-beta.15",
"@girs/clutter-14": "14.0.0-4.0.0-beta.15",
"@girs/gda-5.0": "5.0.0-4.0.0-beta.15",
Expand All @@ -58,6 +60,9 @@
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@tsconfig/strictest": "^2.0.5",
"@types/eslint": "^9.6.1",
"@types/eslint__js": "^8.42.3",
"@types/eslint__eslintrc": "^2.1.2",
"@types/events": "^3.0.3",
"@types/gettext-parser": "^4.0.4",
"@types/highlight.js": "^10.1.0",
Expand All @@ -68,7 +73,7 @@
"@typescript-eslint/parser": "^8.4.0",
"chalk": "^4.1.2",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
Expand Down
Loading

0 comments on commit 0c22d9a

Please sign in to comment.