valor-software / ng2-charts

Beautiful charts for Angular based on Chart.js
http://valor-software.github.io/ng2-charts/
MIT License
2.34k stars 572 forks source link

how to configure eslint-plugin-header (version 3.1.1) with new eslint (9.4.0) which has flat config file (eslint.config.mjs) #1976

Open vishranti5 opened 1 week ago

vishranti5 commented 1 week ago

Reproduction of the problem

ESLint: 9.4.0

Error: Key "rules": Key "header/header": Value ["block",["Your Project Header"]] should NOT have more than 0 items.**

below is my eslint.config.mjs file 👎 import globals from 'globals'; import pluginJs from '@eslint/js'; import tseslint from 'typescript-eslint'; import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js'; import { fixupConfigRules } from '@eslint/compat'; import prettierConfig from 'eslint-config-prettier'; import pluginPrettier from 'eslint-plugin-prettier'; import header from 'eslint-plugin-header';

export default [ { languageOptions: { globals: globals.browser } }, pluginJs.configs.recommended, ...tseslint.configs.recommended, { files: ['*/.{js,jsx,ts,tsx}'], languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } }, settings: { react: { version: 'detect' } }, rules: { // ESLint core rules 'no-shadow': 'off', 'no-empty': 0, // TypeScript specific rules '@typescript-eslint/no-shadow': ['error'], 'no-redeclare': 'off', '@typescript-eslint/no-redeclare': ['error'], 'comma-dangle': 'off', '@typescript-eslint/comma-dangle': ['error'], // Header rules 'header/header': [2, 'block', ['Your Project Header']], // React specific rules 'react/jsx-uses-react': 'off', 'react/react-in-jsx-scope': 'off' } }, ...fixupConfigRules(pluginReactConfig), prettierConfig, { plugins: { prettier: pluginPrettier, header: header }, rules: { 'prettier/prettier': 'error', 'header/header': 'error' } } ];

Bryant-Curtis commented 4 days ago

vishranti5 I'm running into this same issue.

There is a fix for this in progress in the eslint-plugin-header repo FYI https://github.com/Stuk/eslint-plugin-header/issues/57