Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to eslint flat config #6226

Open
acelaya opened this issue Feb 22, 2024 · 1 comment
Open

Migrate to eslint flat config #6226

acelaya opened this issue Feb 22, 2024 · 1 comment

Comments

@acelaya
Copy link
Contributor

acelaya commented Feb 22, 2024

Eslint has a new recommended configuration system (AKA flat config) which is supported by v8, and will be the default in v9.

In order to migrate to it, these are the requirements.

At the time of writing this, eslint only supports js extension for the flat config file. However, mjs and cjs support has been implemented and added to eslint 9 alpha versions.

This means the file needs to be written in CJS format as the package is not defined with type module. We might want to change that at some point.

@acelaya
Copy link
Contributor Author

acelaya commented Feb 22, 2024

Once all pieces involved support flat config, the new config file should look something on these lines:

const tseslint = require('typescript-eslint');
const hypothesis = require('eslint-config-hypothesis');
const jsxA11Y = require('eslint-plugin-jsx-a11y');

module.exports = tseslint.config(hypothesis, jsxA11Y, {
  plugins: {
    '@typescript-eslint': tseslint.plugin,
  },
  languageOptions: {
    parser: tseslint.parser,
  },
  rules: {
    // All rules as defined currently in .eslintrc file
  },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant