master-co / css

The CSS Language and Framework
https://css.master.co
MIT License
1.82k stars 41 forks source link

🐞 [ESLint] A config object is using the "parserOptions" key, which is not supported in flat config system. #339

Closed alanlu-zyl closed 7 months ago

alanlu-zyl commented 8 months ago

Description

monorepo 在個別專案底下設置 .eslintrc.js 搭配 root: true 可以正常運作。

// .eslintrc.cjs

module.exports = {
  root: true,
  extends: ['@master/css'],
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
  },
  overrides: [
    {
      files: ['*.vue'],
      parser: 'vue-eslint-parser',
    },
  ],
};

但如果在根目錄 嘗試平面配置 eslint.config.js 時報錯:

// eslint.config.js

import css from '@master/eslint-config-css/flat';
export default [css];
A config object is using the "parserOptions" key, which is not supported in flat config system.

Flat config uses "languageOptions.parserOptions" to specify parser options.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options

migration-guide#configuring-language-options

Reproduction

https://stackblitz.com/edit/nuxt-starter-zzks8o?file=eslint.config.js

System Informations

No response

1aron commented 7 months ago

Use the ESLint v9's new flat configuration.

import css from '@master/eslint-config-css/flat'

export default [
    css
]

Documentation will be updated asap.