Skip to content

Commit a80cab1

Browse files
Merge pull request #34 from technote-space/feature/suppress_error
feat: suppress error
2 parents b8b03d4 + 460797e commit a80cab1

File tree

16 files changed

+1107
-409
lines changed

16 files changed

+1107
-409
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_style = tab
9+
indent_size = 4
10+
11+
[{*.json,*.yml}]
12+
indent_style = space
13+
indent_size = 2

.eslintrc

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:@typescript-eslint/eslint-recommended"
6+
],
7+
"plugins": [
8+
"@typescript-eslint"
9+
],
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"sourceType": "module",
13+
"ecmaVersion": 2018
14+
},
15+
"env": {
16+
"node": true,
17+
"jest": true,
18+
"es6": true,
19+
"browser": true
20+
},
21+
"settings": {
22+
"react": {
23+
"version": "latest"
24+
}
25+
},
26+
"rules": {
27+
"camelcase": [
28+
"error",
29+
{
30+
"properties": "always"
31+
}
32+
],
33+
"require-jsdoc": [
34+
"error",
35+
{
36+
"require": {
37+
"FunctionDeclaration": true,
38+
"MethodDefinition": true,
39+
"ClassDeclaration": true
40+
}
41+
}
42+
],
43+
"valid-jsdoc": [
44+
"error",
45+
{
46+
"requireReturn": false,
47+
"preferType": {
48+
"String": "string",
49+
"Object": "object",
50+
"Number": "number",
51+
"Function": "function",
52+
"Void": "void"
53+
}
54+
}
55+
],
56+
"quotes": [
57+
"error",
58+
"single",
59+
"avoid-escape"
60+
],
61+
"key-spacing": [
62+
"error",
63+
{
64+
"singleLine": {
65+
"beforeColon": false,
66+
"afterColon": true
67+
},
68+
"multiLine": {
69+
"beforeColon": false,
70+
"afterColon": true
71+
}
72+
}
73+
],
74+
"no-magic-numbers": [
75+
"error",
76+
{
77+
"ignoreArrayIndexes": true
78+
}
79+
],
80+
"eqeqeq": "error",
81+
"block-scoped-var": "error",
82+
"complexity": [
83+
"error",
84+
{
85+
"maximum": 20
86+
}
87+
],
88+
"curly": "error",
89+
"default-case": "error",
90+
"dot-location": [
91+
"error",
92+
"property"
93+
],
94+
"guard-for-in": "error",
95+
"no-eval": "error",
96+
"block-spacing": "error",
97+
"brace-style": "error",
98+
"comma-spacing": [
99+
"error",
100+
{
101+
"before": false,
102+
"after": true
103+
}
104+
],
105+
"id-length": [
106+
"error",
107+
{
108+
"min": 2,
109+
"properties": "never",
110+
"exceptions": [
111+
"$"
112+
]
113+
}
114+
],
115+
"indent": [
116+
"error",
117+
"tab",
118+
{
119+
"MemberExpression": "off"
120+
}
121+
],
122+
"space-before-function-paren": [
123+
"error",
124+
"never"
125+
],
126+
"space-before-blocks": "error",
127+
"prefer-const": "error",
128+
"no-var": "error",
129+
"arrow-body-style": "off",
130+
"arrow-spacing": "error",
131+
"strict": [
132+
"error"
133+
],
134+
"no-warning-comments": [
135+
"warn",
136+
{
137+
"terms": [
138+
"todo",
139+
"fixme",
140+
"hack"
141+
],
142+
"location": "anywhere"
143+
}
144+
],
145+
"semi": [
146+
"error"
147+
]
148+
}
149+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"message": "Resource not accessible by integration",
3+
"documentation_url": "https://developer.github.com/v3"
4+
}

__tests__/util.ts

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
const fs = require('fs');
2-
const path = require('path');
3-
4-
export const getContext = (override: object) => Object.assign({
5-
payload: {
6-
action: '',
7-
},
8-
eventName: '',
9-
sha: '',
10-
ref: '',
11-
workflow: '',
12-
action: '',
13-
actor: '',
14-
issue: {
15-
owner: '',
16-
repo: '',
17-
number: 1,
18-
},
19-
repo: {
20-
owner: '',
21-
repo: '',
22-
},
23-
}, override);
24-
25-
export const getApiFixture = (name: string) => JSON.parse(fs.readFileSync(path.resolve(__dirname, `./fixtures/${name}.json`)));
26-
27-
export const disableNetConnect = nock => {
28-
beforeEach(() => {
29-
nock.disableNetConnect();
30-
});
31-
32-
afterEach(() => {
33-
nock.cleanAll();
34-
nock.enableNetConnect();
35-
});
36-
};
1+
import { Context } from '@actions/github/lib/context';
2+
import * as fs from 'fs';
3+
import * as path from 'path';
4+
5+
export const getContext = (override: object): Context => Object.assign({
6+
payload: {
7+
action: '',
8+
},
9+
eventName: '',
10+
sha: '',
11+
ref: '',
12+
workflow: '',
13+
action: '',
14+
actor: '',
15+
issue: {
16+
owner: '',
17+
repo: '',
18+
number: 1,
19+
},
20+
repo: {
21+
owner: '',
22+
repo: '',
23+
},
24+
}, override);
25+
26+
export const getApiFixture = (name: string): object => JSON.parse(fs.readFileSync(path.resolve(__dirname, `./fixtures/${name}.json`)).toString());
27+
28+
export const disableNetConnect = (nock): void => {
29+
beforeEach(() => {
30+
nock.disableNetConnect();
31+
});
32+
33+
afterEach(() => {
34+
nock.cleanAll();
35+
nock.enableNetConnect();
36+
});
37+
};

0 commit comments

Comments
 (0)