Skip to content

Commit

Permalink
migrate to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Jan 28, 2021
1 parent 0fb75db commit dcbd3b0
Show file tree
Hide file tree
Showing 12 changed files with 3,106 additions and 95 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ jobs:
with:
path: |
~/.npm
~/.pnpm-store
~/.cache/pip
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: install node dependencies
run: npm ci --ignore-scripts
- name: install node packages
uses: pnpm/action-setup@v1.2.1
with:
version: latest
run_install: true
- run: npm test
- name: Publish
run: |
Expand Down
4 changes: 2 additions & 2 deletions bin/branches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ async function main() {
for (const branch of branches.data) {
if (branch.name.match(/^[0-9]+$/)) {
const issue = await octokit.issues.get({ owner, repo, issue_number: parseInt(branch.name) })
if (issue.data.state !== 'open') console.log(branch.name, issue.data.state) // tslint:disable-line:no-console
if (issue.data.state !== 'open') console.log(branch.name, issue.data.state) // eslint-disable-line no-console

} else if (branch.name !== 'master' && branch.name !== 'gh-pages') {
console.log(branch.name) // tslint:disable-line:no-console
console.log(branch.name) // eslint-disable-line no-console

}
}
Expand Down
4 changes: 2 additions & 2 deletions bin/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const build = path.join(root, 'build')
const zotero = process.argv[2]

if (!zotero) {
console.log('No directory specified') // tslint:disable-line:no-console
console.log('No directory specified') // eslint-disable-line no-console
process.exit(1)
}

const extensions = path.join(zotero, 'extensions')
if (!fs.existsSync(extensions)) {
console.log(`${extensions} does not exist`) // tslint:disable-line:no-console
console.log(`${extensions} does not exist`) // eslint-disable-line no-console
process.exit(1)
}

Expand Down
10 changes: 5 additions & 5 deletions bin/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ import version from '../version'
const xpi = `${pkg.name}-${version}.xpi`

const PRERELEASE = false
// tslint:disable-next-line:no-magic-numbers
// eslint-disable-next-line no-magic-numbers
const EXPIRE_BUILDS = moment().subtract(7, 'days').toDate().toISOString()

function bail(msg, status = 1) {
console.log(msg) // tslint:disable-line:no-console
console.log(msg) // eslint-disable-line no-console
process.exit(status)
}

const dryRun = !CI.service
if (dryRun) {
console.log('Not running on CI service, switching to dry-run mode') // tslint:disable-line:no-console
console.log('Not running on CI service, switching to dry-run mode') // eslint-disable-line no-console
CI.branch = require('current-git-branch')()
}

function report(msg) {
console.log(`${dryRun ? 'dry-run: ' : ''}${msg}`) // tslint:disable-line:no-console
console.log(`${dryRun ? 'dry-run: ' : ''}${msg}`) // eslint-disable-line no-console
}

if (CI.pull_request) bail('Not releasing pull requests', 0)
Expand Down Expand Up @@ -83,7 +83,7 @@ async function announce(issue, release) {
try {
await octokit.issues.createComment({ owner, repo, issue_number: issue, body: msg })
} catch (error) {
console.log(`Failed to announce '${build}: ${reason}' on ${issue}`) // tslint:disable-line:no-console
console.log(`Failed to announce '${build}: ${reason}' on ${issue}`) // eslint-disable-line no-console
}
}

Expand Down
2 changes: 1 addition & 1 deletion bin/zipup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import version from '../version'
const [ , , source, target ] = process.argv

const xpi = path.join(root, 'xpi', `${target}-${version}.xpi`)
console.log(`creating ${xpi}`) // tslint:disable-line:no-console
console.log(`creating ${xpi}`) // eslint-disable-line no-console
if (fs.existsSync(xpi)) fs.unlinkSync(xpi)

const archive = archiver.create('zip', {})
Expand Down
2 changes: 1 addition & 1 deletion continuous-integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ class ContinuousIntegrationSingleton {
}
}

export let ContinuousIntegration = new ContinuousIntegrationSingleton // tslint:disable-line:variable-name
export let ContinuousIntegration = new ContinuousIntegrationSingleton // eslint-disable-line @typescript-eslint/naming-convention,no-underscore-dangle,id-blacklist,id-match
2 changes: 1 addition & 1 deletion copy-assets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// tslint:disable:no-console
/* eslint-disable no-console */

import * as fs from 'fs-extra'
import * as glob from 'glob'
Expand Down
2 changes: 1 addition & 1 deletion make-dirs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// tslint:disable:no-console
/* eslint-disable no-console */

import * as rimraf from 'rimraf'
import * as fs from 'fs-extra'
Expand Down

0 comments on commit dcbd3b0

Please sign in to comment.