const path = require('path'); module.exports = (__dirname) => { return { env: { browser: true, es2021: true, es6: true, jest: true, node: true, }, extends: [ 'next', 'prettier', 'eslint:recommended', 'next/core-web-vitals', 'plugin:@typescript-eslint/recommended', 'plugin:storybook/recommended', 'plugin:jsx-a11y/recommended', 'plugin:import/recommended', 'plugin:jsx-fragments/recommended', ], ignorePatterns: [ 'node_modules/*', '.next/*', '.out/*', '!.prettierrc.js', 'next-env.d.ts', 'CHANGELOG.md', 'dist/*', '*.d.ts', '*.d.ts.map', '*.js.map', 'public/*', 'lib.js', ], plugins: [ '@typescript-eslint', // 'unused-imports', 'import', 'jsx-a11y', 'prettier', ], rules: { 'jsx-a11y/media-has-caption': 'off', '@next/next/no-css-tags': 'off', '@next/next/no-html-link-for-pages': 'off', '@next/next/no-img-element': 'off', '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-empty-function': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unused-vars': ['warn'], '@typescript-eslint/no-var-requires': 'off', 'array-bracket-spacing': [ 'error', 'never', { arraysInArrays: false, objectsInArrays: false }, ], 'arrow-parens': ['error', 'always'], 'arrow-spacing': ['error', { after: true, before: true }], 'comma-dangle': ['error', 'only-multiline'], 'curly': 'error', 'eol-last': 'error', 'eqeqeq': ['error', 'always'], 'for-direction': 'error', 'func-names': 'off', 'getter-return': 'error', 'import/default': 'off', 'import/export': 'error', 'import/extensions': ['error', 'never', { json: 'always' }], 'import/first': 'error', 'import/newline-after-import': 'error', 'import/no-absolute-path': 'error', 'import/no-anonymous-default-export': 'off', 'import/no-named-as-default-member': 'off', 'import/no-duplicates': 'error', 'import/no-extraneous-dependencies': [ 'error', { packageDir: [ path.join(__dirname, '/'), path.join(__dirname, '../../'), ], }, ], 'import/no-named-as-default': 'off', 'import/no-self-import': 'error', 'import/no-unresolved': ['error'], 'import/no-useless-path-segments': 'error', 'import/prefer-default-export': 'off', 'jsx-a11y/alt-text': 'off', 'jsx-a11y/anchor-is-valid': 'off', 'jsx-a11y/click-events-have-key-events': 'off', 'jsx-a11y/no-autofocus': 'off', 'keyword-spacing': 'error', 'max-depth': 'off', 'no-alert': 'error', 'no-async-promise-executor': 'error', 'no-class-assign': 'error', 'no-compare-neg-zero': 'error', 'no-cond-assign': 'error', 'no-console': 'error', 'no-const-assign': 'error', 'no-debugger': 'error', 'no-delete-var': 'error', 'no-dupe-args': 'error', 'no-dupe-class-members': 'error', 'no-dupe-keys': 'error', 'no-duplicate-case': 'error', 'no-else-return': 'error', 'no-empty': 'off', 'no-func-assign': 'error', 'no-import-assign': 'error', 'no-inner-declarations': 'error', 'no-invalid-regexp': 'error', 'no-irregular-whitespace': 'error', 'no-misleading-character-class': 'error', 'no-multiple-empty-lines': [ 'error', { max: 1, }, ], 'no-obj-calls': 'error', 'no-return-assign': 'error', 'no-setter-return': 'error', 'no-shadow': 'off', 'no-trailing-spaces': 'error', 'no-undef': 'error', 'no-unreachable': 'error', 'no-unsafe-finally': 'error', 'no-unsafe-negation': 'error', 'no-useless-constructor': 'error', 'no-var': 'error', 'object-curly-newline': 'off', 'object-curly-spacing': ['error', 'always'], 'object-shorthand': ['error', 'always'], 'one-var': ['error', 'never'], 'prefer-const': 'error', 'prettier/prettier': 'error', 'quotes': [ 'error', 'single', { allowTemplateLiterals: true, avoidEscape: true }, ], 'react-hooks/exhaustive-deps': 'off', 'react/forbid-prop-types': 'off', 'react/jsx-filename-extension': 'off', 'react/jsx-indent-props': [2, 2], 'react/jsx-props-no-spreading': 'off', 'react/no-unescaped-entities': 'warn', 'react/prop-types': 'off', 'react/require-default-props': 'off', 'semi': ['error', 'always'], 'spaced-comment': 'error', 'strict': ['error', 'never'], }, settings: { 'import/parsers': { '@typescript-eslint/parser': ['.ts', '.tsx', '.mdx'], }, 'import/resolver': { typescript: { alwaysTryTypes: true, project: [path.join(__dirname, '/tsconfig.json')], }, }, 'next': { rootDir: ['apps/*/', 'packages/*/'], }, }, }; };