Skip to content

Commit

Permalink
chore: use eslint rule eqeqeq (#4234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Jul 13, 2021
1 parent e519548 commit 732d60c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -14,6 +14,7 @@ module.exports = defineConfig({
ecmaVersion: 2020
},
rules: {
eqeqeq: ['warn', 'always', { null: 'never' }],
'no-debugger': ['error'],
'no-empty': ['warn', { allowEmptyCatch: true }],
'no-process-exit': 'off',
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite/index.js
Expand Up @@ -156,7 +156,7 @@ async function init() {
},
{
type: (_, { overwrite } = {}) => {
if (overwrite == false) {
if (overwrite === false) {
throw new Error(red('✖') + ' Operation cancelled')
}
return null
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/testUtils.ts
Expand Up @@ -24,7 +24,7 @@ Object.keys(colors).forEach((color) => {

function componentToHex(c: number): string {
const hex = c.toString(16)
return hex.length == 1 ? '0' + hex : hex
return hex.length === 1 ? '0' + hex : hex
}

function rgbToHex(rgb: string): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/optimizer/scan.ts
Expand Up @@ -229,7 +229,7 @@ function esbuildScanPlugin(
// esbuild to keep crawling due to potential side effects.
let m
const original = js
while ((m = importsRE.exec(original)) !== null) {
while ((m = importsRE.exec(original)) != null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === importsRE.lastIndex) {
importsRE.lastIndex++
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/utils.ts
Expand Up @@ -206,7 +206,7 @@ export function isObject(value: unknown): value is Record<string, any> {
}

export function isDefined<T>(value: T | undefined | null): value is T {
return value !== undefined && value !== null
return value != null
}

export function lookupFile(
Expand Down

0 comments on commit 732d60c

Please sign in to comment.