Skip to content

Commit d26de38

Browse files
committed
fix dangerfile
1 parent 684f906 commit d26de38

File tree

4 files changed

+15
-43
lines changed

4 files changed

+15
-43
lines changed

.eslintrc.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ module.exports = {
2424
project: './tsconfig.json',
2525
},
2626
rules: {
27-
// We want to prevent async await usage in our files to prevent uncessary bundle size. Turned off in tests.
28-
'sentry-sdk/no-async-await': 'error',
29-
3027
// Unused variables should be removed unless they are marked with and underscore (ex. _varName).
3128
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
3229

@@ -71,6 +68,14 @@ module.exports = {
7168
leadingUnderscore: 'require',
7269
},
7370
],
71+
},
72+
},
73+
{
74+
// Configuration for files under src
75+
files: ['src/**/*'],
76+
rules: {
77+
// We want to prevent async await usage in our files to prevent uncessary bundle size.
78+
'sentry-sdk/no-async-await': 'error',
7479

7580
// JSDOC comments are required for classes and methods. As we have a public facing codebase, documentation,
7681
// even if it may seems excessive at times, is important to emphasize. Turned off in tests.
@@ -87,8 +92,6 @@ module.exports = {
8792
},
8893
files: ['*.test.ts', '*.test.tsx', '*.test.js', '*.test.jsx'],
8994
rules: {
90-
'sentry-sdk/no-async-await': 'off',
91-
'jsdoc/require-jsdoc': 'off',
9295
'max-lines': 'off',
9396
},
9497
},

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66
- [ember] feat: Add `@sentry/ember` (#2739)
77
- [apm/tracing] fix: Mark side effects for tracing hub extensions (#2788)
8+
- [browser] ref: Use stronger function return typings (#2786)
89

910
## 5.20.1
1011

dangerfile.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ const packages = ['apm', 'core', 'hub', 'integrations', 'minimal', 'node', 'type
1212
* Eslint your code with Danger
1313
* Based on fork from: https://github.com/appcelerator/danger-plugin-eslint
1414
*/
15-
async function eslint() {
15+
async function eslint(): Promise<void[]> {
1616
const allFiles = danger.git.created_files.concat(danger.git.modified_files);
1717
const cli = new CLIEngine({});
1818
// let eslint filter down to non-ignored, matching the extensions expected
1919
const filesToLint = allFiles.filter(f => !cli.isPathIgnored(f));
2020
return Promise.all(filesToLint.map(f => lintFile(cli, f)));
2121
}
2222

23-
async function lintFile(linter: CLIEngine, path: string) {
23+
/** JSDoc */
24+
async function lintFile(linter: CLIEngine, path: string): Promise<void> {
2425
const contents = await danger.github.utils.fileContents(path);
2526
const report = linter.executeOnText(contents, path);
2627

@@ -31,15 +32,15 @@ async function lintFile(linter: CLIEngine, path: string) {
3132
return;
3233
}
3334

34-
const noop = () => {};
35+
const noop = (): void => undefined;
3536
const fn = { 0: noop, 1: warn, 2: fail }[msg.severity];
3637

3738
fn(`${path} line ${msg.line}${msg.message} (${msg.ruleId})`, path, msg.line);
3839
});
3940
}
4041
}
4142

42-
export default async () => {
43+
export default async (): Promise<void> => {
4344
if (!danger.github) {
4445
return;
4546
}

yarn.lock

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,32 +3287,11 @@ [email protected]:
32873287
resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f"
32883288
integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=
32893289

3290-
agent-base@4, agent-base@^4.3.0:
3291-
version "4.3.0"
3292-
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee"
3293-
integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==
3294-
dependencies:
3295-
es6-promisify "^5.0.0"
3296-
3297-
agent-base@5:
3290+
agent-base@4, agent-base@5, agent-base@6, agent-base@^4.3.0, agent-base@~4.2.1:
32983291
version "5.1.1"
32993292
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c"
33003293
integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==
33013294

3302-
agent-base@6:
3303-
version "6.0.1"
3304-
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.1.tgz#808007e4e5867decb0ab6ab2f928fbdb5a596db4"
3305-
integrity sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==
3306-
dependencies:
3307-
debug "4"
3308-
3309-
agent-base@~4.2.1:
3310-
version "4.2.1"
3311-
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
3312-
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
3313-
dependencies:
3314-
es6-promisify "^5.0.0"
3315-
33163295
agentkeepalive@^3.4.1:
33173296
version "3.5.2"
33183297
resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.2.tgz#a113924dd3fa24a0bc3b78108c450c2abee00f67"
@@ -8531,18 +8510,6 @@ es6-object-assign@^1.1.0:
85318510
resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.1.0.tgz#c2c3582656247c39ea107cb1e6652b6f9f24523c"
85328511
integrity sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=
85338512

8534-
es6-promise@^4.0.3:
8535-
version "4.2.8"
8536-
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a"
8537-
integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==
8538-
8539-
es6-promisify@^5.0.0:
8540-
version "5.0.0"
8541-
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
8542-
integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=
8543-
dependencies:
8544-
es6-promise "^4.0.3"
8545-
85468513
escalade@^3.0.1:
85478514
version "3.0.2"
85488515
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.0.2.tgz#6a580d70edb87880f22b4c91d0d56078df6962c4"

0 commit comments

Comments
 (0)