8000 ref(dev): Run linter on scripts (#4834) · michax/sentry-javascript@5542518 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5542518

Browse files
authored
ref(dev): Run linter on scripts (getsentry#4834)
Because SDK developers running Windows [can't run our bash scripts[1], we recently decided to move to using TypeScript instead. To make this easier, this extends the domain of our `eslint` and `prettier` checks to include all `scripts` folders. It also fixes a few linting errors which doing so brought to light. [1] getsentry#4720
1 parent e134014 commit 5542518

File tree

20 files changed

+41
-47
lines changed

20 files changed

+41
-47
lines changed

.eslintrc.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,7 @@ module.exports = {
1010
ecmaVersion: 2018,
1111
},
1212
extends: ['@sentry-internal/sdk'],
13-
ignorePatterns: [
14-
'coverage/**',
15-
'build/**',
16-
'dist/**',
17-
'esm/**',
18-
'examples/**',
19-
'scripts/**',
20-
'test/manual/**',
21-
'types/**',
22-
],
13+
ignorePatterns: ['coverage/**', 'build/**', 'dist/**', 'esm/**', 'examples/**', 'test/manual/**', 'types/**'],
2314
overrides: [
2415
{
2516
files: ['*.ts', '*.tsx', '*.d.ts'],

packages/angular/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@
5050
"clean": "rimraf dist esm build coverage",
5151
"fix": "run-s fix:eslint fix:prettier",
5252
"fix:eslint": "eslint . --format stylish --fix",
53-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
53+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
5454
"link:yarn": "yarn link",
5555
"lint": "run-s lint:prettier lint:eslint",
5656
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
57-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\""
57+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\""
5858
},
5959
"volta": {
6060
"extends": "../../package.json"

packages/browser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@
6363
"clean": "rimraf build coverage .rpt2_cache",
6464
"fix": "run-s fix:eslint fix:prettier",
6565
"fix:eslint": "eslint . --format stylish --fix",
66-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
66+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
6767
"link:yarn": "yarn link",
6868
"lint": "run-s lint:prettier lint:eslint",
6969
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
70-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
70+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
7171
"size:check": "run-p size:check:es5 size:check:es6",
7272
"size:check:es5": "cat build/bundles/bundle.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES5: \",$1,\"kB\";}'",
7373
"size:check:es6": "cat build/bundles/bundle.es6.min.js | gzip -9 | wc -c | awk '{$1=$1/1024; print \"ES6: \",$1,\"kB\";}'",

packages/browser/scripts/checkbrowsers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
/* eslint-disable no-console */
12
// Script which checks all browsers in test/integration/browser.js against supported BrowserStack browsers
23
// Meant to be run manually, by running `yarn test:integration:checkbrowsers` from the command line
34

45
const btoa = require('btoa');
56
const fetch = require('node-fetch');
7+
68
const localConfigs = require('../test/integration/browsers.js');
79

810
const browserstackUsername = process.env.BROWSERSTACK_USERNAME;
@@ -78,6 +80,7 @@ const checkLocalConfigsVsBrowserStack = (localConfigs, bsConfigs) => {
7880
const realMobileUpdates = [];
7981

8082
// check each local config against the entire collection of BS configs
83+
// eslint-disable-next-line guard-for-in
8184
for (const configName in localConfigs) {
8285
const localConfig = localConfigs[configName];
8386

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@
4040
"clean": "rimraf dist esm coverage",
4141
"fix": "run-s fix:eslint fix:prettier",
4242
"fix:eslint": "eslint . --format stylish --fix",
43-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
43+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
4444
"link:yarn": "yarn link",
4545
"lint": "run-s lint:prettier lint:eslint",
4646
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
47-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
47+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
4848
"test": "jest",
4949
"test:watch": "jest --watch",
5050
"version": "node ../../scripts/versionbump.js src/version.ts"

packages/gatsby/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
"clean": "rimraf dist esm build coverage",
5252
"fix": "run-s fix:eslint fix:prettier",
5353
"fix:eslint": "eslint . --format stylish --fix",
54-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
54+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
5555
"link:yarn": "yarn link",
5656
"lint": "run-s lint:prettier lint:eslint",
5757
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
58-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
58+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
5959
"test": "jest",
6060
"test:watch": "jest --watch"
6161
},

packages/hub/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
"clean": "rimraf dist esm coverage",
3838
"fix": "run-s fix:eslint fix:prettier",
3939
"fix:eslint": "eslint . --format stylish --fix",
40-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
40+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
4141
"link:yarn": "yarn link",
4242
"lint": "run-s lint:prettier lint:eslint",
4343
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
44-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
44+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
4545
"build:npm": "npm pack",
4646
"test": "jest",
4747
"test:watch": "jest --watch"

packages/integrations/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
"clean": "rimraf dist esm build coverage .rpt2_cache",
4444
"fix": "run-s fix:eslint fix:prettier",
4545
"fix:eslint": "eslint . --format stylish --fix",
46-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
46+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
4747
"link:yarn": "yarn link",
4848
"lint": "run-s lint:prettier lint:eslint",
4949
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
50-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
50+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
5151
"test": "jest",
5252
"test:watch": "jest --watch"
5353
},

packages/minimal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
"clean": "rimraf dist esm coverage",
3838
"fix": "run-s fix:eslint fix:prettier",
3939
"fix:eslint": "eslint . --format stylish --fix",
40-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
40+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
4141
"link:yarn": "yarn link",
4242
"lint": "run-s lint:prettier lint:eslint",
4343
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
44-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
44+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
4545
"build:npm": "npm pack",
4646
"test": "jest",
4747
"test:watch": "jest --watch"

packages/nextjs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@
6060
"clean": "rimraf dist esm coverage *.js *.js.map *.d.ts",
6161
"fix": "run-s fix:eslint fix:prettier",
6262
"fix:eslint": "eslint . --format stylish --fix",
63-
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
63+
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
6464
"link:yarn": "yarn link",
6565
"lint": "run-s lint:prettier lint:eslint",
6666
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
67-
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
67+
"lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
6868
"test": "run-s test:unit",
6969
"test:all": "run-s test:unit test:integration",
7070
"test:unit": "jest",

0 commit comments

Comments
 (0)
0