Skip to content

Commit dc1e7a7

Browse files
committed
build: Switch @sentry/gatsby to using eslint
1 parent b8b9253 commit dc1e7a7

File tree

7 files changed

+37
-14
lines changed

7 files changed

+37
-14
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# THIS WILL BE REMOVED AFTER WE FINISH ESLINT UPGRADE
33

44
packages/ember/**/*
5-
packages/gatsby/**/*
65
packages/integrations/**/*
76
packages/node/**/*
87
packages/react/**/*

packages/angular/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module.exports = {
22
root: true,
33
env: {
44
es6: true,
5+
browser: true,
56
},
67
parserOptions: {
78
ecmaVersion: 2018,

packages/gatsby/.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es6: true,
5+
browser: true,
6+
node: true,
7+
},
8+
parserOptions: {
9+
ecmaVersion: 2018,
10+
},
11+
extends: ['../../.eslintrc.js'],
12+
ignorePatterns: ['build/**/*', 'dist/**/*', 'esm/**/*', 'examples/**/*', 'scripts/**/*'],
13+
overrides: [
14+
{
15+
files: ['*.ts', '*.tsx', '*.d.ts'],
16+
parserOptions: {
17+
project: './tsconfig.json',
18+
},
19+
},
20+
],
21+
};

packages/gatsby/gatsby-browser.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ exports.onClientEntry = function(_, pluginParams) {
66
let BrowserTracingIntegration = undefined;
77
try {
88
BrowserTracingIntegration = require('@sentry/tracing').Integrations.BrowserTracing;
9-
} catch (_) {}
9+
} catch (_) {
10+
/* no-empty */
11+
}
1012
try {
1113
/** @deprecated Remove when @sentry/apm is no longer used */
1214
TracingIntegration = require('@sentry/apm').Integrations.Tracing;
13-
} catch (_) {}
15+
} catch (_) {
16+
/* no-empty */
17+
}
1418

1519
const tracesSampleRate = pluginParams.tracesSampleRate !== undefined ? pluginParams.tracesSampleRate : 0;
1620
const integrations = [...(pluginParams.integrations || [])];
@@ -25,7 +29,9 @@ exports.onClientEntry = function(_, pluginParams) {
2529

2630
Sentry.init({
2731
environment: process.env.NODE_ENV || 'development',
32+
// eslint-disable-next-line no-undef
2833
release: __SENTRY_RELEASE__,
34+
// eslint-disable-next-line no-undef
2935
dsn: __SENTRY_DSN__,
3036
...pluginParams,
3137
tracesSampleRate,

packages/gatsby/gatsby-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ exports.onCreateWebpackConfig = ({ plugins, actions }) => {
33
plugins: [
44
plugins.define({
55
__SENTRY_RELEASE__: JSON.stringify(
6-
process.env.SENTRY_RELEASE ||
6+
process.env.SENTRY_RELEASE ||
77
// GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
88
process.env.GITHUB_SHA ||
99
// Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata

packages/gatsby/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@
5050
"build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
5151
"clean": "rimraf dist coverage build esm",
5252
"link:yarn": "yarn link",
53-
"lint": "run-s lint:prettier lint:tslint",
54-
"lint:prettier": "prettier-check \"{src,test}/**/*.{ts,tsx}\"",
55-
"lint:tslint": "tslint -t stylish -p .",
56-
"lint:tslint:json": "tslint --format json -p . | tee lint-results.json",
57-
"fix": "run-s fix:tslint fix:prettier",
58-
"fix:prettier": "prettier --write \"{src,test}/**/*.{ts,tsx}\"",
59-
"fix:tslint": "tslint --fix -t stylish -p .",
53+
"lint": "run-s lint:prettier lint:eslint",
54+
"lint:prettier": "prettier-check \"{src,test}/**/*.ts\"",
55+
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
56+
"fix": "run-s fix:eslint fix:prettier",
57+
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
58+
"fix:eslint": "eslint . --format stylish --fix",
6059
"test": "jest",
6160
"test:watch": "jest --watch"
6261
},

packages/gatsby/tslint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)