-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
enhancementNew feature or requestNew feature or requesttech: lintingtechnology support requestRequests support for a new technologyRequests support for a new technology
Description
To do:
- Switch to
@typescript-eslint.- Make ESLint CNS plugin install and add parser
@typescript-eslint/parserto.eslintrc.cjs. - Make ESLint CNS plugin install and add plugin
@typescript-eslint/eslint-pluginto.eslintrc.cjs.
- Make ESLint CNS plugin install and add parser
- Make it possible to choose between the official configurations.
- Make ESLint CNS plugin install and add config
eslint-config-prettierto.eslintrc.cjsif Prettier is used. - Make it possible to choose between ESLint configs
nextandnext/core-web-vitals.next:nextis an alias fornext/recommendedwhich includes Next-specific linting rules, but also bundles other useful ESLint plugins likeimport,react,react-hooksandjsx-a11y, and Next-specific overrides of these plugins. See theeslint-plugin-nextsource.next/core-web-vitals: Extendsnext/recommended, turning a couple core web vitals-specific ESLint rules from warnings into errors. See thecore-web-vitalsconfig source.
See the typescript-eslint configuration docs, mainly this quote:
We recommend that most projects should extend from one of:
recommended: Recommended rules for code correctness that you can drop in without additional configuration.recommended-type-checked: Containsrecommended+ additional recommended rules that require type information.strict: Containsrecommended+ additional strict rules that can also catch bugs but are more opinionated than recommended rules.strict-type-checked: Containsstrict+ additional strict rules require type information.Additionally, we provide a stylistic config that enforces concise and consistent code. We recommend that most projects should extend from either:
stylistic: Stylistic rules you can drop in without additional configuration.stylistic-type-checked: Containsstylistic+ additional stylistic rules that require type information.
Example setup using @typescript-eslint/parser and @typescript-eslint/plugin as well as typed versions of both strict and stylistic:
/** @type {import("eslint").Linter.Config} */
const config = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'next/core-web-vitals',
'prettier',
],
};
module.exports = config;Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesttech: lintingtechnology support requestRequests support for a new technologyRequests support for a new technology