2021-04-30 13:09:07 +02:00
|
|
|
/*
|
|
|
|
* @rushstack/eslint-patch is used to include plugins as dev
|
|
|
|
* dependencies instead of imposing them as peer dependencies
|
|
|
|
*
|
|
|
|
* https://www.npmjs.com/package/@rushstack/eslint-patch
|
|
|
|
*/
|
|
|
|
require('@rushstack/eslint-patch/modern-module-resolution')
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
extends: [
|
|
|
|
'plugin:react/recommended',
|
|
|
|
'plugin:react-hooks/recommended',
|
|
|
|
'plugin:@next/next/recommended',
|
|
|
|
],
|
2021-06-01 09:10:52 +02:00
|
|
|
plugins: ['import', 'react', 'jsx-a11y'],
|
2021-04-30 13:09:07 +02:00
|
|
|
rules: {
|
|
|
|
'import/no-anonymous-default-export': 'warn',
|
|
|
|
'react/react-in-jsx-scope': 'off',
|
2021-06-03 14:01:24 +02:00
|
|
|
'react/prop-types': 'off',
|
2021-06-01 09:10:52 +02:00
|
|
|
'jsx-a11y/alt-text': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
elements: ['img'],
|
|
|
|
img: ['Image'],
|
|
|
|
},
|
|
|
|
],
|
2021-07-27 17:07:56 +02:00
|
|
|
'jsx-a11y/aria-props': 'warn',
|
|
|
|
'jsx-a11y/aria-proptypes': 'warn',
|
|
|
|
'jsx-a11y/aria-unsupported-elements': 'warn',
|
|
|
|
'jsx-a11y/role-has-required-aria-props': 'warn',
|
|
|
|
'jsx-a11y/role-supports-aria-props': 'warn',
|
2021-04-30 13:09:07 +02:00
|
|
|
},
|
|
|
|
parser: './parser.js',
|
|
|
|
parserOptions: {
|
|
|
|
requireConfigFile: false,
|
|
|
|
sourceType: 'module',
|
|
|
|
allowImportExportEverywhere: true,
|
|
|
|
babelOptions: {
|
|
|
|
presets: ['next/babel'],
|
2021-07-16 20:19:08 +02:00
|
|
|
caller: {
|
|
|
|
// Eslint supports top level await when a parser for it is included. We enable the parser by default for Babel.
|
|
|
|
supportsTopLevelAwait: true,
|
|
|
|
},
|
2021-04-30 13:09:07 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ['**/*.ts?(x)'],
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
parserOptions: {
|
|
|
|
sourceType: 'module',
|
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true,
|
|
|
|
},
|
|
|
|
warnOnUnsupportedTypeScriptVersion: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
settings: {
|
|
|
|
react: {
|
|
|
|
version: 'detect',
|
|
|
|
},
|
|
|
|
'import/parsers': {
|
|
|
|
[require.resolve('@typescript-eslint/parser')]: ['.ts', '.tsx', '.d.ts'],
|
|
|
|
},
|
|
|
|
'import/resolver': {
|
|
|
|
[require.resolve('eslint-import-resolver-node')]: {
|
|
|
|
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
|
|
},
|
2021-06-18 15:17:53 +02:00
|
|
|
[require.resolve('eslint-import-resolver-typescript')]: {
|
|
|
|
alwaysTryTypes: true,
|
|
|
|
},
|
2021-04-30 13:09:07 +02:00
|
|
|
},
|
|
|
|
},
|
2021-08-05 02:58:06 +02:00
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
node: true,
|
|
|
|
},
|
2021-04-30 13:09:07 +02:00
|
|
|
}
|