529574f83a
We've had a few issues where .only in tests wasn't getting caught by our lint rules. Turns out it's because we were excluding tests from eslint completely ### Change Type - [x] `internal` — Any other changes that don't affect the published package (will not publish a new version) ### Release Notes internal-only change
86 lines
2.1 KiB
JavaScript
86 lines
2.1 KiB
JavaScript
module.exports = {
|
|
extends: [
|
|
'prettier',
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:@next/next/core-web-vitals',
|
|
],
|
|
ignorePatterns: ['e2e/wdio.*.js'],
|
|
plugins: ['@typescript-eslint', 'no-only-tests', 'import', 'local', '@next/next', 'react-hooks'],
|
|
settings: {
|
|
next: {
|
|
rootDir: ['apps/*/', 'packages/*/'],
|
|
},
|
|
},
|
|
rules: {
|
|
'@next/next/no-html-link-for-pages': 'off',
|
|
'react/jsx-key': 'off',
|
|
'no-non-null-assertion': 'off',
|
|
'no-fallthrough': 'off',
|
|
'@typescript-eslint/no-fallthrough': 'off',
|
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
'react/display-name': 'off',
|
|
'@next/next/no-img-element': 'off',
|
|
'@typescript-eslint/no-extra-semi': 'off',
|
|
'no-mixed-spaces-and-tabs': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
'no-throw-literal': 'error',
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
'react-hooks/exhaustive-deps': 'error',
|
|
'import/no-extraneous-dependencies': 'error',
|
|
'import/no-internal-modules': ['error', { forbid: ['@tldraw/*/**'] }],
|
|
'@typescript-eslint/consistent-type-exports': [
|
|
'error',
|
|
{ fixMixedExportsWithInlineTypeSpecifier: true },
|
|
],
|
|
'local/no-export-star': 'error',
|
|
'no-only-tests/no-only-tests': 'error',
|
|
},
|
|
parser: '@typescript-eslint/parser',
|
|
parserOptions: {
|
|
project: true,
|
|
},
|
|
overrides: [
|
|
{
|
|
// enable the rule specifically for TypeScript files
|
|
files: ['*.ts', '*.tsx'],
|
|
rules: {
|
|
'@typescript-eslint/explicit-module-boundary-types': [0],
|
|
'no-console': ['error', { allow: ['warn', 'error'] }],
|
|
},
|
|
},
|
|
{
|
|
files: ['apps/fixup/**/*', 'scripts/**/*'],
|
|
rules: {
|
|
'no-console': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['e2e/**/*'],
|
|
rules: {
|
|
'@typescript-eslint/no-empty-function': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: 'scripts/**/*',
|
|
rules: {
|
|
'import/no-extraneous-dependencies': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['apps/examples/**/*'],
|
|
rules: {
|
|
'import/no-internal-modules': 'off',
|
|
},
|
|
},
|
|
],
|
|
}
|