Skip to content

Commit

Permalink
feat: extraneous dep check
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Dec 14, 2023
1 parent 011af6e commit 26d9137
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 56 deletions.
106 changes: 60 additions & 46 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,36 @@ module.exports = {
es6: true,
},
extends: [
'eslint-config-salesforce',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'eslint-config-prettier',
"eslint-config-salesforce",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"eslint-config-prettier",
],
parser: '@typescript-eslint/parser',
parser: "@typescript-eslint/parser",
parserOptions: {
project: [
'./packages/**/tsconfig.json',
'./packages/**/test/tsconfig.json',
'./tsconfig.json',
'./test/tsconfig.json',
"./packages/**/tsconfig.json",
"./packages/**/test/tsconfig.json",
"./tsconfig.json",
"./test/tsconfig.json",
],
sourceType: 'module',
sourceType: "module",
},
plugins: ['@typescript-eslint', 'eslint-plugin-import', 'eslint-plugin-jsdoc', 'unicorn'],
plugins: [
"@typescript-eslint",
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"unicorn",
],
rules: {
'unicorn/prefer-node-protocol': 'error',
"unicorn/prefer-node-protocol": "error",
"import/no-extraneous-dependencies": ["off"],
// Override @typescript-eslint/recommended
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNullish: true,
allowBoolean: true,
Expand All @@ -35,56 +41,64 @@ module.exports = {
],

// Custom @typescript-eslint
'@typescript-eslint/array-type': [
'error',
"@typescript-eslint/array-type": [
"error",
{
default: 'array-simple',
default: "array-simple",
},
],
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error',
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: 'explicit',
accessibility: "explicit",
},
],
'@typescript-eslint/member-delimiter-style': [
'error',
"@typescript-eslint/member-delimiter-style": [
"error",
{
multiline: {
delimiter: 'semi',
delimiter: "semi",
requireLast: true,
},
singleline: {
delimiter: 'semi',
delimiter: "semi",
requireLast: false,
},
},
],
'@typescript-eslint/member-ordering': 'error',
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/no-shadow": "error",
'@typescript-eslint/return-await': 'error',
"@typescript-eslint/return-await": "error",
// turning off the base rule is recommended by ts-eslint
'no-return-await': 'off',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/quotes': [
'error',
'single',
"no-return-await": "off",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-reduce-type-parameter": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/quotes": [
"error",
"single",
{
avoidEscape: true,
},
],
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unified-signatures': 'error',
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"no-shadow": "off",
},
ignorePatterns: ['*.js'],
ignorePatterns: ["*.js"],
overrides: [
{
files: ["src/**"],
rules: {
"import/no-extraneous-dependencies": "error",
},
},
],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"eslint-config-salesforce": "^2.0.2",
"eslint-config-salesforce-license": "^0.2.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^46.9.0",
"eslint-plugin-unicorn": "^49.0.0"
}
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,10 @@ eslint-plugin-header@^3.1.1:
resolved "https://registry.yarnpkg.com/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz#6ce512432d57675265fac47292b50d1eff11acd6"
integrity sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==

eslint-plugin-import@^2.29.0:
version "2.29.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz#8133232e4329ee344f2f612885ac3073b0b7e155"
integrity sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==
eslint-plugin-import@^2.29.1:
version "2.29.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz#d45b37b5ef5901d639c15270d74d46d161150643"
integrity sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==
dependencies:
array-includes "^3.1.7"
array.prototype.findlastindex "^1.2.3"
Expand All @@ -654,7 +654,7 @@ eslint-plugin-import@^2.29.0:
object.groupby "^1.0.1"
object.values "^1.1.7"
semver "^6.3.1"
tsconfig-paths "^3.14.2"
tsconfig-paths "^3.15.0"

eslint-plugin-jsdoc@^46.9.0:
version "46.9.0"
Expand Down Expand Up @@ -1793,10 +1793,10 @@ ts-api-utils@^1.0.1:
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331"
integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==

tsconfig-paths@^3.14.2:
version "3.14.2"
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088"
integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==
tsconfig-paths@^3.15.0:
version "3.15.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4"
integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==
dependencies:
"@types/json5" "^0.0.29"
json5 "^1.0.2"
Expand Down

0 comments on commit 26d9137

Please sign in to comment.