From a947bf45e9e9300d654920c2afbb8ca38fba5972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Bora?= Date: Wed, 17 May 2023 23:41:21 +0200 Subject: [PATCH] fix: rules --- packages/eslint-config-react/index.js | 2 +- packages/eslint-config-ts/index.js | 46 +-------------------------- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/packages/eslint-config-react/index.js b/packages/eslint-config-react/index.js index 245afa9..ebe2fdb 100644 --- a/packages/eslint-config-react/index.js +++ b/packages/eslint-config-react/index.js @@ -6,7 +6,7 @@ module.exports = { ], settings: { react: { - version: '17.0', + version: 'detect', }, }, rules: { diff --git a/packages/eslint-config-ts/index.js b/packages/eslint-config-ts/index.js index cffcfc8..4dee0bd 100644 --- a/packages/eslint-config-ts/index.js +++ b/packages/eslint-config-ts/index.js @@ -1,9 +1,3 @@ -const fs = require('node:fs'); -const { join } = require('node:path'); -const basic = require('@owowagency/eslint-config-basic'); - -const tsconfig = process.env.ESLINT_TSCONFIG || 'tsconfig.eslint.json'; - module.exports = { extends: [ '@owowagency/eslint-config-basic', @@ -15,44 +9,6 @@ module.exports = { node: { extensions: ['.js', '.jsx', '.mjs', '.ts', '.tsx', '.d.ts'] }, }, }, - overrides: basic.overrides.concat( - !fs.existsSync(join(process.cwd(), tsconfig)) - ? [] - : [ - { - parserOptions: { - tsconfigRootDir: process.cwd(), - project: [tsconfig], - }, - parser: '@typescript-eslint/parser', - excludedFiles: ['**/*.md/*.*'], - files: ['*.ts', '*.tsx', '*.mts', '*.cts'], - rules: { - 'no-throw-literal': 'off', - '@typescript-eslint/no-throw-literal': 'error', - 'no-implied-eval': 'off', - '@typescript-eslint/no-implied-eval': 'error', - 'dot-notation': 'off', - '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }], - '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/no-misused-promises': 'error', - '@typescript-eslint/await-thenable': 'error', - '@typescript-eslint/no-for-in-array': 'error', - '@typescript-eslint/no-unnecessary-type-assertion': 'error', - '@typescript-eslint/no-unsafe-argument': 'error', - '@typescript-eslint/no-unsafe-assignment': 'error', - '@typescript-eslint/no-unsafe-call': 'error', - '@typescript-eslint/no-unsafe-member-access': 'error', - '@typescript-eslint/no-unsafe-return': 'error', - 'require-await': 'off', - '@typescript-eslint/require-await': 'error', - '@typescript-eslint/restrict-plus-operands': 'error', - '@typescript-eslint/restrict-template-expressions': 'error', - '@typescript-eslint/unbound-method': 'error', - }, - }, - ], - ), rules: { 'import/named': 'off', @@ -107,7 +63,7 @@ module.exports = { offsetTernaryExpressions: true, }], 'no-invalid-this': 'off', - '@typescript-eslint/no-invalid-this': 'error', + '@typescript-eslint/no-invalid-this': 'off', 'no-redeclare': 'off', '@typescript-eslint/no-redeclare': 'error', 'no-use-before-define': 'off',