Skip to content

Commit fbd909b

Browse files
committed
Lint files before release
1 parent 4c2e099 commit fbd909b

File tree

10 files changed

+22
-15
lines changed

10 files changed

+22
-15
lines changed

packages/run-chrome-extension/steps/RunChromePlugin/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {type Compiler} from 'webpack'
44
import {spawn} from 'child_process'
55
import {bgWhite, bold, black, red, blue} from '@colors/colors/safe'
66
// @ts-ignore
7-
import chrome from 'chrome-location'
7+
import chromeLocation from 'chrome-location'
88
import browserConfig from './chrome/browser.config'
99
import {type PluginOptions} from '../../types'
1010

@@ -24,6 +24,7 @@ export default class ChromeExtensionLauncherPlugin {
2424
}
2525

2626
private launchChrome() {
27+
const chrome: string = chromeLocation
2728
if (!fs.existsSync(path.resolve(chrome))) {
2829
console.error(
2930
`${bgWhite(black(bold(` chrome-browser `)))} ${red(

packages/run-chrome-extension/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchCSP.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function patchV2CSP(manifest: ManifestBase) {
1111
)
1212
}
1313

14-
let csp = parse(policy)
14+
const csp = parse(policy)
1515
policy = ''
1616

1717
// Modification logic remains the same

packages/run-edge-extension/steps/RunEdgePlugin/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from 'fs'
22
import path from 'path'
33
import {type Compiler} from 'webpack'
44
import {spawn} from 'child_process'
5-
import {bgCyan, bold, green, white, red, blue} from '@colors/colors/safe'
5+
import {bgCyan, bold, white, red, blue} from '@colors/colors/safe'
66
// @ts-ignore
77
import edge from 'edge-location'
88
import browserConfig from './edge/browser.config'

packages/run-edge-extension/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchCSP.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function patchV2CSP(manifest: ManifestBase) {
1111
)
1212
}
1313

14-
let csp = parse(policy)
14+
const csp = parse(policy)
1515
policy = ''
1616

1717
// Modification logic remains the same

packages/run-firefox-addon/steps/CreateWebSocketServer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default class CreateWebSocketServer {
3939
const hardcodedMessage = {
4040
data: {
4141
id: manifest.browser_specific_settings?.gecko?.id,
42-
manifest: manifest,
42+
manifest,
4343
management: {
4444
id: manifest.browser_specific_settings?.gecko?.id,
4545
mayDisable: true,

packages/run-firefox-addon/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchCSP.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function patchV2CSP(manifest: ManifestBase) {
1111
)
1212
}
1313

14-
let csp = parse(policy)
14+
const csp = parse(policy)
1515
policy = ''
1616

1717
// Modification logic remains the same

programs/develop/steps/generateZip.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from 'path'
22
import {blue, white, yellow, bold, underline} from '@colors/colors/safe'
33
import AdmZip from 'adm-zip'
44
import slugify from 'slugify'
5-
import {BuildOptions} from '../extensionBuild'
5+
import {type BuildOptions} from '../extensionBuild'
66
import fs from 'fs'
77
import ignore from 'ignore'
88
import {glob} from 'glob'
@@ -36,7 +36,10 @@ function getExtensionExtension(vendor: string): string {
3636
}
3737
}
3838

39-
function getPackageName(manifest: any, options: BuildOptions): string {
39+
function getPackageName(
40+
manifest: Record<string, string>,
41+
options: BuildOptions
42+
): string {
4043
const sanitizedStr = sanitizeString(options.zipFilename || manifest.name)
4144
if (options.zipFilename) return sanitizedStr
4245

@@ -72,7 +75,9 @@ export default function generateZip(
7275
const outputDir = path.join(projectDir, 'dist', browser)
7376
// We collect data from the projectDir if the user wants to zip the source files.
7477
const dataDir = options.zipSource ? projectDir : outputDir
75-
const manifest = require(path.join(dataDir, 'manifest.json'))
78+
const manifest: Record<string, string> = require(
79+
path.join(dataDir, 'manifest.json')
80+
)
7681
const name = getPackageName(manifest, options)
7782
const ext = getExtensionExtension(browser)
7883
const distZipPath = path.join(outputDir, `${name}.${ext}`)
@@ -86,9 +91,9 @@ export default function generateZip(
8691
)
8792
const zip = new AdmZip()
8893
const files = getFilesToZip(projectDir)
89-
files.forEach((file) =>
94+
files.forEach((file) => {
9095
zip.addLocalFile(path.join(projectDir, file), path.dirname(file))
91-
)
96+
})
9297
zip.writeZip(sourceZipPath)
9398
}
9499

programs/develop/steps/getProjectPath.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import downloadAndExtractZip from './extractFromZip'
1212

1313
const isUrl = (url: string) => {
1414
try {
15+
// eslint-disable-next-line no-new
1516
new URL(url)
1617
return true
1718
} catch (e) {

programs/develop/webpack/buildWebpack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default function buildWebpack(
9797
const browser = options.browser || 'chrome'
9898
const webpackConfig = compilerConfig(projectDir, {
9999
mode: 'production',
100-
browser: browser
100+
browser
101101
})
102102

103103
const webpackConfigNoBrowser = {

programs/develop/webpack/plugins/CleanHotUpdatesPlugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as fs from 'fs'
2-
import * as path from 'path'
3-
import {Compilation, Compiler} from 'webpack'
1+
import fs from 'fs'
2+
import path from 'path'
3+
import {type Compiler} from 'webpack'
44

55
export default class CleanHotUpdatesPlugin {
66
apply(compiler: Compiler): void {

0 commit comments

Comments
 (0)