mirror of
https://github.com/antebudimir/eslint-plugin-vanilla-extract.git
synced 2025-12-31 08:53:33 +00:00
feat 🥁: add ESLint v9 extends field support and document 8.57.0 compatibility
- confirm compatibility with ESLint 8.57.0 - add support for ESLint v9 extends field in flat config - maintain backward compatibility with existing usage patterns - update docs with configuration examples This commit enhances the plugin's configuration options for ESLint v9 users while ensuring backward compatibility. Users can now use the familiar extends syntax with flat config, simplifying integration into existing projects. Documentation has been updated to demonstrate proper usage with both ESLint 8 and 9.
This commit is contained in:
parent
f880c051ff
commit
35875fbb31
5 changed files with 197 additions and 67 deletions
|
|
@ -1,22 +1,10 @@
|
|||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { FlatCompat } from '@eslint/eslintrc';
|
||||
import eslintPluginESLintPlugin from 'eslint-plugin-eslint-plugin';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
import prettierConfig from 'eslint-config-prettier';
|
||||
import * as tseslint from 'typescript-eslint';
|
||||
|
||||
// mimic CommonJS variables
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
|
||||
export default [
|
||||
// mimic ESLintRC-style extends
|
||||
// Prettier always must be last to override other style rules
|
||||
...compat.extends('prettier'),
|
||||
export default defineConfig([
|
||||
{
|
||||
files: ['**/*.js', '**/*.ts', '**/*.cjs', '**/*.mjs'],
|
||||
plugins: {
|
||||
|
|
@ -74,6 +62,7 @@ export default [
|
|||
'import/export': 'error',
|
||||
},
|
||||
},
|
||||
|
||||
...tseslint.configs.recommended,
|
||||
|
||||
{
|
||||
|
|
@ -103,4 +92,6 @@ export default [
|
|||
'no-unused-vars': 'off',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
prettierConfig,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue