Skip to content

Commit

Permalink
build(eslint): Move ts and emotion lint rules to config (#17666)
Browse files Browse the repository at this point in the history
This moves our ts and emotion lint rules to our eslint config.
  • Loading branch information
billyvg committed Mar 17, 2020
1 parent 91e7a1d commit be28616
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 61 deletions.
17 changes: 2 additions & 15 deletions .eslintrc.js
@@ -1,6 +1,4 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'emotion'],
extends: ['sentry-app/strict'],
globals: {
require: false,
Expand All @@ -11,22 +9,11 @@ module.exports = {
tick: true,
jest: true,
},
rules: {
'emotion/jsx-import': 'off',
'emotion/no-vanilla': 'error',
'emotion/import-from-emotion': 'error',
'emotion/styled-import': 'error',
},
rules: {},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'no-unused-vars': 'off',

// https://github.com/yannickcr/eslint-plugin-react/issues/2066
'react/sort-comp': 'warn',
},
rules: {},
},
],
};
14 changes: 8 additions & 6 deletions .eslintrc.relax.js
Expand Up @@ -4,10 +4,12 @@ module.exports = {
...strict,
extends: ['sentry-app'],

rules: {
'emotion/jsx-import': 'off',
'emotion/no-vanilla': 'warn',
'emotion/import-from-emotion': 'error',
'emotion/styled-import': 'error',
},
rules: {},

overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {},
},
],
};
5 changes: 1 addition & 4 deletions package.json
Expand Up @@ -144,8 +144,6 @@
"@storybook/addon-storysource": "^5.3.3",
"@storybook/addons": "^5.3.3",
"@storybook/react": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.6.1",
"babel-eslint": "^10.0.3",
"babel-gettext-extractor": "^4.1.3",
"babel-jest": "24.9.0",
Expand All @@ -155,8 +153,7 @@
"enzyme-adapter-react-16": "1.15.1",
"enzyme-to-json": "3.4.3",
"eslint": "5.11.1",
"eslint-config-sentry-app": "1.34.0",
"eslint-plugin-emotion": "^10.0.14",
"eslint-config-sentry-app": "1.35.0",
"jest": "24.9.0",
"jest-canvas-mock": "^2.2.0",
"jest-junit": "^9.0.0",
Expand Down
80 changes: 44 additions & 36 deletions yarn.lock
Expand Up @@ -2793,24 +2793,24 @@
resolved "https://registry.yarnpkg.com/@types/zrender/-/zrender-4.0.0.tgz#a6806f12ec4eccaaebd9b0d816f049aca6188fbd"
integrity sha512-s89GOIeKFiod2KSqHkfd2rzx+T2DVu7ihZCBEBnhFrzvQPUmzvDSBot9Fi1DfMQm9Odg+rTqoMGC38RvrwJK2w==

"@typescript-eslint/eslint-plugin@^2.10.0":
version "2.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.17.0.tgz#880435a9f9bdd50b45fa286ba63fed723d73c837"
integrity sha512-tg/OMOtPeXlvk0ES8mZzEZ4gd1ruSE03nsKcK+teJhxYv5CPCXK6Mb/OK6NpB4+CqGTHs4MVeoSZXNFqpT1PyQ==
"@typescript-eslint/eslint-plugin@^2.23.0":
version "2.23.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.23.0.tgz#aa7133bfb7b685379d9eafe4ae9e08b9037e129d"
integrity sha512-8iA4FvRsz8qTjR0L/nK9RcRUN3QtIHQiOm69FzV7WS3SE+7P7DyGGwh3k4UNR2JBbk+Ej2Io+jLAaqKibNhmtw==
dependencies:
"@typescript-eslint/experimental-utils" "2.17.0"
"@typescript-eslint/experimental-utils" "2.23.0"
eslint-utils "^1.4.3"
functional-red-black-tree "^1.0.1"
regexpp "^3.0.0"
tsutils "^3.17.1"

"@typescript-eslint/experimental-utils@2.17.0":
version "2.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.17.0.tgz#12ed4a5d656e02ff47a93efc7d1ce1b8f1242351"
integrity sha512-2bNf+mZ/3mj5/3CP56v+ldRK3vFy9jOvmCPs/Gr2DeSJh+asPZrhFniv4QmQsHWQFPJFWhFHgkGgJeRmK4m8iQ==
"@typescript-eslint/experimental-utils@2.23.0":
version "2.23.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-2.23.0.tgz#5d2261c8038ec1698ca4435a8da479c661dc9242"
integrity sha512-OswxY59RcXH3NNPmq+4Kis2CYZPurRU6mG5xPcn24CjFyfdVli5mySwZz/g/xDbJXgDsYqNGq7enV0IziWGXVQ==
dependencies:
"@types/json-schema" "^7.0.3"
"@typescript-eslint/typescript-estree" "2.17.0"
"@typescript-eslint/typescript-estree" "2.23.0"
eslint-scope "^5.0.0"

"@typescript-eslint/experimental-utils@^1.13.0":
Expand All @@ -2822,14 +2822,14 @@
"@typescript-eslint/typescript-estree" "1.13.0"
eslint-scope "^4.0.0"

"@typescript-eslint/parser@^2.6.1":
version "2.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.17.0.tgz#627f79586d868edbab55f46a6b183cdc341aea1d"
integrity sha512-k1g3gRQ4fwfJoIfgUpz78AovicSWKFANmvTfkAHP24MgJHjWfZI6ya7tsQZt1sLczvP4G9BE5G5MgADHdmJB/w==
"@typescript-eslint/parser@^2.23.0":
version "2.23.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-2.23.0.tgz#f3d4e2928ff647fe77fc2fcef1a3534fee6a3212"
integrity sha512-k61pn/Nepk43qa1oLMiyqApC6x5eP5ddPz6VUYXCAuXxbmRLqkPYzkFRKl42ltxzB2luvejlVncrEpflgQoSUg==
dependencies:
"@types/eslint-visitor-keys" "^1.0.0"
"@typescript-eslint/experimental-utils" "2.17.0"
"@typescript-eslint/typescript-estree" "2.17.0"
"@typescript-eslint/experimental-utils" "2.23.0"
"@typescript-eslint/typescript-estree" "2.23.0"
eslint-visitor-keys "^1.1.0"

"@typescript-eslint/typescript-estree@1.13.0":
Expand All @@ -2840,10 +2840,10 @@
lodash.unescape "4.0.1"
semver "5.5.0"

"@typescript-eslint/typescript-estree@2.17.0":
version "2.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.17.0.tgz#2ce1531ec0925ef8d22d7026235917c2638a82af"
integrity sha512-g0eVRULGnEEUakxRfJO0s0Hr1LLQqsI6OrkiCLpdHtdJJek+wyd8mb00vedqAoWldeDcOcP8plqw8/jx9Gr3Lw==
"@typescript-eslint/typescript-estree@2.23.0":
version "2.23.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-2.23.0.tgz#d355960fab96bd550855488dcc34b9a4acac8d36"
integrity sha512-pmf7IlmvXdlEXvE/JWNNJpEvwBV59wtJqA8MLAxMKLXNKVRC3HZBXR/SlZLPWTCcwOSg9IM7GeRSV3SIerGVqw==
dependencies:
debug "^4.1.1"
eslint-visitor-keys "^1.1.0"
Expand Down Expand Up @@ -6175,25 +6175,28 @@ eslint-config-prettier@6.3.0:
dependencies:
get-stdin "^6.0.0"

eslint-config-sentry-app@1.34.0:
version "1.34.0"
resolved "https://registry.yarnpkg.com/eslint-config-sentry-app/-/eslint-config-sentry-app-1.34.0.tgz#21fdbc1260369db0c138ef54aae6b9b9efd9a3fe"
integrity sha512-a0XTToLj9szIfmfPT255MA9OA+SloQYXDMB568h23Gpw95vyRr+73ypqvctd2fvnbusexXDlfUvpBqipjBmwXA==
eslint-config-sentry-app@1.35.0:
version "1.35.0"
resolved "https://registry.yarnpkg.com/eslint-config-sentry-app/-/eslint-config-sentry-app-1.35.0.tgz#6db464e3fac02c37bc0316e370dd9886b17a2a20"
integrity sha512-MpgWr151oF2lF7okPx8PK5qf3T7ijiL8H3LORH2qlxQMLsNTx6JhrfRdVfcwGrGrFkQWGf6BfLVaK+YWTYxWgA==
dependencies:
"@typescript-eslint/eslint-plugin" "^2.23.0"
"@typescript-eslint/parser" "^2.23.0"
eslint-config-prettier "6.3.0"
eslint-config-sentry "^1.34.0"
eslint-config-sentry-react "^1.34.0"
eslint-config-sentry-react "^1.35.0"
eslint-import-resolver-webpack "0.12.1"
eslint-plugin-emotion "^10.0.27"
eslint-plugin-import "2.20.1"
eslint-plugin-jest "22.17.0"
eslint-plugin-prettier "3.1.1"
eslint-plugin-react "7.15.1"
eslint-plugin-sentry "^1.30.0"
eslint-plugin-sentry "^1.35.0"

eslint-config-sentry-react@^1.34.0:
version "1.34.0"
resolved "https://registry.yarnpkg.com/eslint-config-sentry-react/-/eslint-config-sentry-react-1.34.0.tgz#6d495c06fab68bfa09086c79cc075d9337c74757"
integrity sha512-amN68jIpmPZliI3vVZz8wmfZNYRn+6qSuR3IQtBkY6YUB06jS727n/vRk5AWGOblTjPvvYnlsK1akanI/kfTMQ==
eslint-config-sentry-react@^1.35.0:
version "1.35.0"
resolved "https://registry.yarnpkg.com/eslint-config-sentry-react/-/eslint-config-sentry-react-1.35.0.tgz#0ec43c1b39204d3351695d2727fdbfcf989633e9"
integrity sha512-82n/KHoh/oX+808eXVoru+aDFR9pLcOmkimXm0amCNkPNi/Q5Bx8yqRcO0FajrGQ1n2LlFy7oOMEPfhm7uimMA==
dependencies:
eslint-config-sentry "^1.34.0"

Expand Down Expand Up @@ -6234,7 +6237,7 @@ eslint-module-utils@^2.4.1:
debug "^2.6.9"
pkg-dir "^2.0.0"

eslint-plugin-emotion@^10.0.14:
eslint-plugin-emotion@^10.0.27:
version "10.0.27"
resolved "https://registry.yarnpkg.com/eslint-plugin-emotion/-/eslint-plugin-emotion-10.0.27.tgz#577a4265cc679f7bb826437a92fb9d709928e0a7"
integrity sha512-0IG9KWmyQTAWZNM4WoGjFbdre1Xq6uMp2jYOSHvh3ZNcDfOjOLXeH3ky1MuWZlbWIHxz/Ed5DMGlJAeKnd26VA==
Expand Down Expand Up @@ -6286,10 +6289,10 @@ eslint-plugin-react@7.15.1:
prop-types "^15.7.2"
resolve "^1.12.0"

eslint-plugin-sentry@^1.30.0:
version "1.30.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-sentry/-/eslint-plugin-sentry-1.30.0.tgz#1bc276cec0638a3c776c172dcf22f8b3b3669023"
integrity sha512-RPHCMv01HkG6L64nBBujzgG/CVCfk6WYACjvMuO+sxTySVU/bN2u7xa64ytR+7BrA3PM+mGQAg197ng19ijrLw==
eslint-plugin-sentry@^1.35.0:
version "1.35.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-sentry/-/eslint-plugin-sentry-1.35.0.tgz#ffef605286c07431138984d85c74cff56cb954f4"
integrity sha512-GK4eUQW+gntTmU+IVS+sJGCVkrlFuUjALz57RkAvCNHvtU7YEwinZpttjSTxKn+Kae1dW9vrs0gllMiHxbfXpQ==
dependencies:
requireindex "~1.1.0"

Expand Down Expand Up @@ -14749,11 +14752,16 @@ tsconfig-paths@^3.4.0:
minimist "^1.2.0"
strip-bom "^3.0.0"

tslib@1.10.0, tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
tslib@1.10.0, tslib@^1.10.0, tslib@^1.9.0, tslib@^1.9.3:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==

tslib@^1.8.1:
version "1.11.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==

tsutils@^3.17.1:
version "3.17.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
Expand Down

0 comments on commit be28616

Please sign in to comment.