mirror of
https://github.com/hanzoai/extension.git
synced 2026-10-31 21:57:06 +00:00
The catalog moved hanzo-ide from ESLint 8 to 10 and typescript-eslint from 6 to 8. ESLint 10 reads only eslint.config.*, so `eslint .` stopped with "couldn't find an eslint.config.* file", which failed the package's pretest before a test ran. eslint.config.mjs carries .eslintrc.json over rule for rule, with the renames the upgrade forces: eslint:recommended is @eslint/js, which ESLint 10 no longer ships, so it joins the catalog; typescript-eslint 8 moved `semi` to @stylistic/eslint-plugin; and it flags the lazy requires the old config allowed (no-var-requires: off) as no-require-imports. ESLint no longer skips dot-directories, so .vscode-test/ is ignored by name. ESLint 10's recommended set is larger than 8's. The next commit fixes what it finds. Co-authored-by: Hanzo Dev <[email protected]>
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
// .eslintrc.json in the form ESLint 10 reads; it reads no other.
|
|
import js from '@eslint/js';
|
|
import stylistic from '@stylistic/eslint-plugin';
|
|
import typescript from '@typescript-eslint/eslint-plugin';
|
|
|
|
export default [
|
|
{ ignores: ['out/', 'dist/', 'scripts/', '.vscode-test/', '**/*.d.ts', '**/*.js'] },
|
|
js.configs.recommended,
|
|
...typescript.configs['flat/recommended'],
|
|
{
|
|
plugins: { '@stylistic': stylistic },
|
|
rules: {
|
|
'@typescript-eslint/naming-convention': 'warn',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'warn',
|
|
// Lazy CJS requires are how this extension keeps activation fast.
|
|
// The old config turned off no-var-requires for them; typescript-
|
|
// eslint 8 flags them under this name.
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
// typescript-eslint 8 moved its semi rule to @stylistic.
|
|
'@stylistic/semi': 'warn',
|
|
'curly': 'warn',
|
|
'eqeqeq': 'warn',
|
|
'no-throw-literal': 'warn'
|
|
}
|
|
}
|
|
];
|