Skip to content

Commit

Permalink
feat: make rules stronger
Browse files Browse the repository at this point in the history
  • Loading branch information
akhmyrov authored Sep 15, 2022
2 parents b8f6d84 + da308df commit cdd4a55
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 74 deletions.
9 changes: 9 additions & 0 deletions __tests__/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ const validateConfig = (config: string) => {
const eslint = new ESLint({
overrideConfigFile: config,
useEslintrc: false,
overrideConfig: {
// should be set in project, not in lib
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
},
},
})
return eslint.lintText('')
}
Expand Down
50 changes: 0 additions & 50 deletions global.d.ts

This file was deleted.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bestdoctor/eslint-config",
"version": "0.5.8",
"version": "0.6.0",
"description": "BestDoctor ESLint config",
"main": "index.js",
"author": "NMVikings",
Expand All @@ -19,6 +19,7 @@
"eslint-plugin-tsdoc": "^0.2.11"
},
"devDependencies": {
"@types/eslint": "^8.4.6",
"@types/jest": "^25.2.2",
"eslint": "^7.0.0",
"jest": "^26.0.1",
Expand All @@ -27,9 +28,9 @@
"typescript": "^3.9.2"
},
"peerDependencies": {
"eslint": ">=6.0.0",
"prettier": ">=1.18.0",
"typescript": ">=3.5.0"
"eslint": ">=7.0.0",
"prettier": ">=2.0.0",
"typescript": ">=4.0.0"
},
"scripts": {
"test": "jest",
Expand Down
20 changes: 0 additions & 20 deletions rules/@typescript-eslint.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
module.exports = {
parser: '@typescript-eslint/parser',

parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
},

plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'],

extends: [
Expand All @@ -30,16 +23,6 @@ module.exports = {
],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'tsdoc/syntax': 'warn',
},
Expand All @@ -49,8 +32,5 @@ module.exports = {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
},
},
}
2 changes: 2 additions & 0 deletions rules/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module.exports = {
'**/*.stories.tsx',
'**/fixtures.ts',
'**/setupTests.ts',
'**/jest-setup.ts',
'**/jest-setup.tsx',
'./*.ts',
'./*.js',
],
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,19 @@
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==

"@types/eslint@^8.4.6":
version "8.4.6"
resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.6.tgz#7976f054c1bccfcf514bff0564c0c41df5c08207"
integrity sha512-/fqTbjxyFUaYNO7VcW5g+4npmqVACz1bB7RTHYuLj+PRjw9hrCwrUXVQFpChUS0JsyEFvMZ7U/PfmvWgxJhI9g==
dependencies:
"@types/estree" "*"
"@types/json-schema" "*"

"@types/estree@*":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2"
integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==

"@types/graceful-fs@^4.1.2":
version "4.1.3"
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.3.tgz#039af35fe26bec35003e8d86d2ee9c586354348f"
Expand Down Expand Up @@ -644,6 +657,11 @@
jest-diff "^25.2.1"
pretty-format "^25.2.1"

"@types/json-schema@*":
version "7.0.11"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3"
integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==

"@types/json-schema@^7.0.3":
version "7.0.4"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339"
Expand Down

0 comments on commit cdd4a55

Please sign in to comment.