Skip to content

Commit

Permalink
fix: migrated to eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
necm1 committed Jul 24, 2024
1 parent 378a855 commit 390a742
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: npm install --legacy-peer-deps

- name: Run ESLint
run: npx eslint --no-ignore 'src/**/*.ts'
run: npx eslint 'src/**/*.ts'

- name: Run Prettier
run: npx prettier --check 'src/**/*.ts'
Expand Down
31 changes: 30 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
/dist
# Ignore build output directories
dist/

# Ignore node modules
node_modules/

# Ignore specific configuration files
*.config.js

# Ignore environment variables files
.env
.env.*

# Ignore lock files
yarn.lock
package-lock.json

# Ignore logs
*.log

# Ignore compiled files
*.min.js
*.min.css

# Ignore specific file types
*.png
*.jpg
*.jpeg
*.gif
*.svg
65 changes: 44 additions & 21 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
export default {
ignores: ['node_modules', 'dist'],
env: {
browser: true,
es2021: true,
node: true,
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import tsParser from '@typescript-eslint/parser';

export default [
{
ignores: ['node_modules', 'dist'],
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
{
files: ['**/*.{js,mjs,cjs,ts}'],
},
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
{
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
project: './tsconfig.json',
},
globals: globals.browser,
},
},
};
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintConfigPrettier,
{
rules: {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
},
},
];
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,23 @@
"author": "necm1 <[email protected]>",
"license": "MIT",
"devDependencies": {
"@eslint/js": "^9.7.0",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"eslint": "^9.7.0",
"eslint": "9.x",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.8.0",
"husky": "^9.1.1",
"lint-staged": "^15.2.7",
"pinst": "^3.0.0",
"prettier": "^3.3.3",
"rollup": "^4.19.0",
"rollup-plugin-terser": "^7.0.2",
"tslib": "^2.6.3",
"typescript": "^5.5.4"
"typescript": "^5.5.4",
"typescript-eslint": "^7.17.0"
},
"dependencies": {
"postcss": "^8.4.39"
Expand Down
Loading

0 comments on commit 390a742

Please sign in to comment.