A custom eslint config supporting TypeScript, React and JSON.
This configuration is based on airbnb and typescript-eslint. For supporting JSON files eslint-plugin-json
is being used, support for Prettier has been also added.
In addition, a few rules have been customized.
In order to use this configuration, one also has to install the peer dependencies eslint
, prettier
and typescript
. After installing eslint-config-tonalio
, adding "extends": "tonalio"
to your eslint configuration file should be sufficient. You may also want to add a prettier config file.
Next.JS provides some additional linting rules, which are not included in this configuration. It is therefore recommended to change your eslint config to include:
{
"extends": [
"tonalio",
"plugin:@next/next/recommended",
"plugin:@next/next/core-web-vitals"
]
}
You need to install the package @next/eslint-plugin-next
.
@typescript-eslint
to v6 and prettier
to v3react/react-in-jsx-scope
since it's not necessary anymore in NextJS & others[email protected]
, [email protected]
, [email protected]
)[email protected]
, [email protected]
, [email protected]
)@typescript-eslint/no-misused-promises
for void returnseslint-plugin-json
and eslint-config-prettier
@typescript-eslint
to support TypeScript v4, updated eslint-config-airbnb-typescript
to v12eslint-config-airbnb-typescript
to v9, eslint to v7 and prettier to v2@typescript-eslint/naming-convention
for unused _
parameters@typescript-eslint/explicit-module-boundary-types
for React files@typescript-eslint/naming-convention
rule@typescript-eslint/naming-convention
@typescript-eslint/no-unsafe-*
rulescamelcase
ruletypescript-eslint
to v3, which drops support for Node v8 and TypeScript v3.2latest
.