lintをGitHub Actions でするように (#6101)

* package.json の lint スクリプトを修正

* lint アクションを追加

* yarn lint --fix

* 手動修正
This commit is contained in:
rinsuki 2020-03-04 11:45:33 +09:00 committed by GitHub
parent 678ff17d0f
commit c18f6fde80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 34 additions and 24 deletions

View File

@ -41,3 +41,13 @@ jobs:
run: yarn build run: yarn build
- name: Test - name: Test
run: yarn test run: yarn test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- run: yarn install
- run: yarn lint

View File

@ -21,7 +21,7 @@
"gulp": "gulp build", "gulp": "gulp build",
"clean": "gulp clean", "clean": "gulp clean",
"cleanall": "gulp cleanall", "cleanall": "gulp cleanall",
"lint": "gulp lint", "lint": "tslint 'src/**/*.ts'",
"test": "cross-env TS_NODE_FILES=true gulp test", "test": "cross-env TS_NODE_FILES=true gulp test",
"format": "gulp format" "format": "gulp format"
}, },

View File

@ -171,6 +171,7 @@ declare module 'jsrsasign' {
public static getTLVbyList(h: ASN1S, currentIndex: Idx<ASN1ObjectString>, nthList: Mutable<Nth[]>, checkingTag?: string): ASN1TLV; public static getTLVbyList(h: ASN1S, currentIndex: Idx<ASN1ObjectString>, nthList: Mutable<Nth[]>, checkingTag?: string): ASN1TLV;
// tslint:disable-next-line:bool-param-default
public static getVbyList(h: ASN1S, currentIndex: Idx<ASN1ObjectString>, nthList: Mutable<Nth[]>, checkingTag?: string, removeUnusedbits?: boolean): ASN1V; public static getVbyList(h: ASN1S, currentIndex: Idx<ASN1ObjectString>, nthList: Mutable<Nth[]>, checkingTag?: string, removeUnusedbits?: boolean): ASN1V;
public static hextooidstr(hex: ASN1OIDV): OID; public static hextooidstr(hex: ASN1OIDV): OID;
@ -620,9 +621,7 @@ declare module 'jsrsasign' {
public encrypt(text: string): HexString | null; public encrypt(text: string): HexString | null;
public encryptOAEP(text: string, hash?: string, hashLen?: number): HexString | null; public encryptOAEP(text: string, hash?: string | ((s: string) => string), hashLen?: number): HexString | null;
public encryptOAEP(text: string, hash?: (s: string) => string, hashLen?: number): HexString | null;
//// RSA PRIVATE //// RSA PRIVATE
@ -638,9 +637,7 @@ declare module 'jsrsasign' {
public decrypt(ctext: HexString): string; public decrypt(ctext: HexString): string;
public decryptOAEP(ctext: HexString, hash?: string, hashLen?: number): string | null; public decryptOAEP(ctext: HexString, hash?: string | ((s: string) => string), hashLen?: number): string | null;
public encryptOAEP(ctext: HexString, hash?: (s: string) => string, hashLen?: number): string | null;
//// RSA PEM //// RSA PEM

View File

@ -81,14 +81,14 @@ if (lang == null) {
// Detect the user agent // Detect the user agent
const ua = navigator.userAgent.toLowerCase(); const ua = navigator.userAgent.toLowerCase();
let isMobile = /mobile|iphone|ipad|android/.test(ua); const isMobile = /mobile|iphone|ipad|android/.test(ua);
// Get the <head> element // Get the <head> element
const head = document.getElementsByTagName('head')[0]; const head = document.getElementsByTagName('head')[0];
// If mobile, insert the viewport meta tag // If mobile, insert the viewport meta tag
if (isMobile || window.innerWidth <= 1024) { if (isMobile || window.innerWidth <= 1024) {
const viewport = document.getElementsByName("viewport").item(0); const viewport = document.getElementsByName('viewport').item(0);
viewport.setAttribute('content', viewport.setAttribute('content',
`${viewport.getAttribute('content')},minimum-scale=1,maximum-scale=1,user-scalable=no`); `${viewport.getAttribute('content')},minimum-scale=1,maximum-scale=1,user-scalable=no`);
head.appendChild(viewport); head.appendChild(viewport);

View File

@ -11,7 +11,8 @@ export default class extends Channel {
public async init(params: any) { public async init(params: any) {
// Subscribe main stream channel // Subscribe main stream channel
this.subscriber.on(`mainStream:${this.user!.id}`, async data => { this.subscriber.on(`mainStream:${this.user!.id}`, async data => {
let { type, body } = data; const { type } = data;
let { body } = data;
switch (type) { switch (type) {
case 'notification': { case 'notification': {

View File

@ -61,7 +61,9 @@
"no-duplicated-branches": false, "no-duplicated-branches": false,
"no-identical-conditions": false, "no-identical-conditions": false,
"no-useless-cast": false, "no-useless-cast": false,
"no-hardcoded-credentials": false "no-hardcoded-credentials": false,
"no-nested-switch": false,
"unified-signatures": false
}, },
"rulesDirectory": [] "rulesDirectory": []
} }