From c8b5389847c7e5bb40d674e3a9689e4a14028e3e Mon Sep 17 00:00:00 2001 From: fisker Date: Thu, 12 Mar 2020 13:02:24 +0800 Subject: [PATCH] Fix misspellings --- rules/filename-case.js | 4 ++-- rules/no-nested-ternary.js | 4 ++-- rules/utils/avoid-capture.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rules/filename-case.js b/rules/filename-case.js index 42bbe521f5..428763cd0b 100644 --- a/rules/filename-case.js +++ b/rules/filename-case.js @@ -88,9 +88,9 @@ function fixFilename(words, caseFunctions, {leading, extension}) { return combinations.map(parts => `${leading}${parts.join('')}${extension}`); } -const leadingUnserscoresRegex = /^(?_+)(?.*)$/; +const leadingUnderscoresRegex = /^(?_+)(?.*)$/; function splitFilename(filename) { - const result = leadingUnserscoresRegex.exec(filename) || {groups: {}}; + const result = leadingUnderscoresRegex.exec(filename) || {groups: {}}; const {leading = '', tailing = filename} = result.groups; const words = []; diff --git a/rules/no-nested-ternary.js b/rules/no-nested-ternary.js index f25fe98395..d8b922a7b8 100644 --- a/rules/no-nested-ternary.js +++ b/rules/no-nested-ternary.js @@ -1,7 +1,7 @@ 'use strict'; const getDocumentationUrl = require('./utils/get-documentation-url'); -const isParethesized = (sourceCode, node) => { +const isParenthesized = (sourceCode, node) => { const previousToken = sourceCode.getTokenBefore(node); const nextToken = sourceCode.getTokenAfter(node); @@ -35,7 +35,7 @@ const create = context => { ) { context.report({node, message}); break; - } else if (!isParethesized(sourceCode, childNode)) { + } else if (!isParenthesized(sourceCode, childNode)) { context.report({ node: childNode, message, diff --git a/rules/utils/avoid-capture.js b/rules/utils/avoid-capture.js index 06e843c87e..350b23aec7 100644 --- a/rules/utils/avoid-capture.js +++ b/rules/utils/avoid-capture.js @@ -62,7 +62,7 @@ Useful when you want to rename a variable (or create a new variable) while being @param {Scope[]} scopes - The list of scopes the new variable will be referenced in. @param {number} ecmaVersion - The language version, get it from `context.parserOptions.ecmaVersion`. @param {isSafe} [isSafe] - Rule-specific name check function. -@returns {string} - Either `name` as is, or a string like `${name}_` suffixed with undescores to make the name unique. +@returns {string} - Either `name` as is, or a string like `${name}_` suffixed with underscores to make the name unique. */ module.exports = (name, scopes, ecmaVersion, isSafe = alwaysTrue) => { const isStrict = someScopeIsStrict(scopes);