Skip to content

Commit

Permalink
deps: Bump eslint to v9 + migrate to flat config
Browse files Browse the repository at this point in the history
Migrated the eslint config using `npx @eslint/migrate-config .eslintrc.json`, and did not work flawlessly, obviously

I had to include config to examples into the root config file.
Instead, we are able to delete `.eslintrc` that existed for each example directory though

`require-atomic-updates` (has been set to `off`) does not exist in the default configs, so removed the line

`@typescript-eslint/no-unnecessary-type-assertion` requires a type assertion, removed it for now
  • Loading branch information
0b5vr committed Dec 27, 2024
1 parent bb924d4 commit 7a21f5f
Show file tree
Hide file tree
Showing 11 changed files with 343 additions and 215 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

90 changes: 90 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import html from 'eslint-plugin-html';
import { FlatCompat } from '@eslint/eslintrc';

const compat = new FlatCompat({});

export default tseslint.config(
{
files: ['**/*.{js,mjs,ts}'],
ignores: [
'packages/*/docs/',
'packages/*/lib/',
'packages/*/node_modules/',
'packages/*/types/',

'packages/*/examples/**/*.{js,html}',

'**/jest.config.js',
],
extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
],
rules: {
curly: ['error', 'multi-line'],

'no-console': ['error', {
allow: ['info', 'warn', 'error'],
}],

'@typescript-eslint/naming-convention': ['error', {
selector: 'default',
format: ['camelCase'],
}, {
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
}, {
selector: 'typeLike',
format: ['PascalCase'],
}, {
selector: 'memberLike',
modifiers: ['public'],
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'forbid',
}, {
selector: 'memberLike',
modifiers: ['protected'],
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'require',
}, {
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'require',
}, {
selector: 'enumMember',
format: ['PascalCase'],
}, {
selector: 'import',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
}],

'@typescript-eslint/no-unused-vars': ['warn', {
args: 'none',
}],

'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': ['off'],
},
},

{
files: ['packages/*/examples/**/*.{js,html}'],
extends: [
eslint.configs.recommended,
...compat.extends('mdcs'),
],
plugins: {
html,
},
rules: {
'padded-blocks': 'off',
'no-unused-vars': 'off',
},
},
);
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@
"prepare": "husky"
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.17.0",
"@gltf-transform/core": "^4.0.8",
"@types/jest": "^29.5.12",
"@types/node": "^22.7.5",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"cross-env": "^7.0.2",
"esbuild": "^0.24.0",
"eslint": "8",
"eslint": "^9.17.0",
"eslint-config-mdcs": "^5.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-html": "^8.1.1",
"eslint-plugin-html": "^8.1.2",
"globals": "^15.14.0",
"husky": "^9.1.5",
"jest": "^29.7.0",
"lerna": "^8.1.8",
Expand All @@ -39,7 +42,8 @@
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typedoc": "^0.26.9",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"typescript-eslint": "^8.18.2"
},
"name": "three-vrm"
}
11 changes: 0 additions & 11 deletions packages/three-vrm-animation/examples/.eslintrc

This file was deleted.

11 changes: 0 additions & 11 deletions packages/three-vrm-core/examples/.eslintrc

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions packages/three-vrm-materials-mtoon/examples/.eslintrc

This file was deleted.

11 changes: 0 additions & 11 deletions packages/three-vrm-node-constraint/examples/.eslintrc

This file was deleted.

11 changes: 0 additions & 11 deletions packages/three-vrm-springbone/examples/.eslintrc

This file was deleted.

11 changes: 0 additions & 11 deletions packages/three-vrm/examples/.eslintrc

This file was deleted.

Loading

0 comments on commit 7a21f5f

Please sign in to comment.