Skip to content

Commit

Permalink
fix: standard linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaUnknown committed Jan 22, 2023
1 parent 9d9066e commit a64a719
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 23 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 1,21 @@
module.exports = {
env: {
es2022: true,
browser: true,
node: true,
serviceworker: true
},
extends: ['standard'],
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
requireConfigFile: false,
babelOptions: {
parserOpts: {
plugins: ['importAssertions']
}
}
},
ignorePatterns: ['node_modules', 'dist']
}
3 changes: 0 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 1,4 @@
/*! webtorrent. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
/* global FileList */
/* eslint-env browser */

import EventEmitter from 'events'
import path from 'path'
import concat from 'simple-concat'
Expand Down
2 changes: 0 additions & 2 deletions lib/torrent.js
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
/* global Blob */

import EventEmitter from 'events'
import fs from 'fs'
import net from 'net' // browser exclude
Expand Down
3 changes: 0 additions & 3 deletions lib/worker-server.js
Original file line number Diff line number Diff line change
@@ -1,6 1,3 @@
/* global clients, MessageChannel, ReadableStream, Response */
/* eslint-env serviceworker */

const portTimeoutDuration = 5000
let cancellable = false

Expand Down
2 changes: 0 additions & 2 deletions lib/worker.js
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
/* eslint-env serviceworker */

import fileResponse from './worker-server.js'

self.addEventListener('install', () => {
Expand Down
19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 36,8 @@
"@webtorrent/http-node": "^1.3.0",
"addr-to-ip-port": "^1.5.4",
"bitfield": "^4.1.0",
"bittorrent-protocol": "^4.0.1",
"bittorrent-dht": "^10.0.7",
"bittorrent-protocol": "^4.0.1",
"cache-chunk-store": "^3.2.2",
"chunk-store-iterator": "^1.0.2",
"cpus": "^1.0.3",
Expand Down Expand Up @@ -76,6 76,7 @@
},
"devDependencies": {
"@babel/core": "7.20.2",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-syntax-import-assertions": "7.20.0",
"@babel/preset-env": "7.20.2",
"@webtorrent/semantic-release-config": "1.0.8",
Expand All @@ -87,14 88,18 @@
"buffer": "^6.0.3",
"chrome-net": "^3.3.4",
"disc": "1.3.3",
"eslint": "^8.32.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-promise": "^6.1.1",
"finalhandler": "1.2.0",
"network-address": "1.1.2",
"pako": "^2.1.0",
"path-browserify": "^1.0.1",
"run-series": "1.1.9",
"semantic-release": "20.0.2",
"serve-static": "1.15.0",
"standard": "*",
"stream-http": "^3.2.0",
"tap-spec": "^5.0.0",
"tape": "5.6.3",
Expand Down Expand Up @@ -157,20 162,12 @@
"size": "npm run size-js && npm run size-disc",
"size-disc": "npm run build-js && cat ./dist/webtorrent.min.js | discify --open",
"size-js": "npm run build-js && cat ./dist/webtorrent.min.js | gzip | wc -c",
"test": "standard && npm run test-node && npm run test-browser | tap-spec",
"test": "eslint . && npm run test-node && npm run test-browser | tap-spec",
"test-browser": "airtap --concurrency 1 -- test/*.js test/browser/*.js | tap-spec",
"test-browser-local": "airtap --preset local -- test/*.js test/browser/*.js | tap-spec",
"test-node": "tape test/*.js test/node/*.js | tap-spec",

"update-authors": "./scripts/update-authors.sh"
},
"standard": {
"ignore": [
"webtorrent.min.js",
"sw.min.js",
"webtorrent.chromeapp.js"
]
},
"renovate": {
"extends": [
"github>webtorrent/renovate-config"
Expand Down
2 changes: 0 additions & 2 deletions test/client-seed.js
Original file line number Diff line number Diff line change
@@ -1,5 1,3 @@
/* global Blob */

import fixtures from 'webtorrent-fixtures'
import test from 'tape'
import WebTorrent from '../index.js'
Expand Down

0 comments on commit a64a719

Please sign in to comment.