Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: fix typos#11744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
undsoft wants to merge2 commits intotypescript-eslint:main
base:main
Choose a base branch
Loading
fromundsoft:typos
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -419,7 +419,7 @@ export default createRule<Options, MessageIds>({

if (isNoFormatTagged) {
if (literal.parent.type === AST_NODE_TYPES.TaggedTemplateExpression) {
checkForUnnecesaryNoFormat(code, literal.parent);
checkForUnnecessaryNoFormat(code, literal.parent);
}
return;
}
Expand DownExpand Up@@ -455,7 +455,7 @@ export default createRule<Options, MessageIds>({
return tag.type === AST_NODE_TYPES.Identifier && tag.name === 'noFormat';
}

functioncheckForUnnecesaryNoFormat(
functioncheckForUnnecessaryNoFormat(
text: string,
expr: TSESTree.TaggedTemplateExpression,
): void {
Expand All@@ -480,7 +480,7 @@ export default createRule<Options, MessageIds>({
): void {
if (isNoFormatTemplateTag(expr.tag)) {
const { cooked } = expr.quasi.quasis[0].value;
checkForUnnecesaryNoFormat(cooked, expr);
checkForUnnecessaryNoFormat(cooked, expr);
} else {
return;
}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -232,14 +232,14 @@ export default createRule<Options, MessageIds>({
token.value === 'public'
) {
keywordRange = structuredClone(token.range);
constcommensAfterPublicKeyword =
constcommentsAfterPublicKeyword =
context.sourceCode.getCommentsAfter(token);
if (commensAfterPublicKeyword.length) {
if (commentsAfterPublicKeyword.length) {
// public /* Hi there! */ static foo()
// ^^^^^^^
rangeToRemove = [
token.range[0],
commensAfterPublicKeyword[0].range[0],
commentsAfterPublicKeyword[0].range[0],
];
break;
} else {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,7 +88,7 @@ export default createRule<Options, MessageId>({
messages: {
conditional: 'Expected non-Promise value in a boolean conditional.',
predicate: 'Expected a non-Promise value to be returned.',
spread: 'Expected a non-Promise value to bespreaded in an object.',
spread: 'Expected a non-Promise value to bespread in an object.',
voidReturnArgument:
'Promise returned in function argument where a void return was expected.',
voidReturnAttribute:
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/no-misused-spread.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -154,15 +154,15 @@ export default createRule<Options, MessageIds>({
function getPromiseSpreadSuggestions(
node: TSESTree.Expression,
): TSESLint.ReportSuggestionArray<MessageIds> {
constisHighPrecendence = isHigherPrecedenceThanAwait(
constisHighPrecedence = isHigherPrecedenceThanAwait(
services.esTreeNodeToTSNodeMap.get(node),
);

return [
{
messageId: 'addAwait',
fix: fixer =>
isHighPrecendence
isHighPrecedence
? fixer.insertTextBefore(node, 'await ')
: [
fixer.insertTextBefore(node, 'await ('),
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -193,7 +193,7 @@ export default createRule<[], MessageId>({
});
}

functionisUnncessaryValueInterpolation({
functionisUnnecessaryValueInterpolation({
interpolation,
nextQuasi,
prevQuasi,
Expand DownExpand Up@@ -432,7 +432,7 @@ export default createRule<[], MessageId>({
}

constinfos=getInterpolationInfos(node).filter(
isUnncessaryValueInterpolation,
isUnnecessaryValueInterpolation,
);

for(constreportDescriptorofgetReportDescriptors(infos)){
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -169,11 +169,11 @@ function getTypeParametersFromType(
return undefined;
}

constsortedDeclaraions = sortDeclarationsByTypeValueContext(
constsortedDeclarations = sortDeclarationsByTypeValueContext(
node,
declarations,
);
return findFirstResult(sortedDeclaraions, decl => {
return findFirstResult(sortedDeclarations, decl => {
if (
ts.isTypeAliasDeclaration(decl) ||
ts.isInterfaceDeclaration(decl) ||
Expand Down
4 changes: 2 additions & 2 deletionspackages/eslint-plugin/src/rules/return-await.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -267,9 +267,9 @@ export default createRule({
function insertAwait(
fixer: TSESLint.RuleFixer,
node: TSESTree.Expression,
isHighPrecendence: boolean,
isHighPrecedence: boolean,
): TSESLint.RuleFix | TSESLint.RuleFix[] {
if (isHighPrecendence) {
if (isHighPrecedence) {
return fixer.insertTextBefore(node, 'await ');
}
return [
Expand Down
8 changes: 4 additions & 4 deletionspackages/eslint-plugin/src/util/collectUnusedVariables.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -188,7 +188,7 @@ class UnusedVarsVisitor extends Visitor {
// basic exported variables
isExported(variable) ||
// variables implicitly exported via a merged declaration
isMergableExported(variable) ||
isMergeableExported(variable) ||
// used variables
isUsedVariable(variable)
) {
Expand DownExpand Up@@ -415,7 +415,7 @@ function isSelfReference(
return false;
}

constMERGABLE_TYPES = new Set([
constMERGEABLE_TYPES = new Set([
AST_NODE_TYPES.ClassDeclaration,
AST_NODE_TYPES.FunctionDeclaration,
AST_NODE_TYPES.TSInterfaceDeclaration,
Expand All@@ -426,7 +426,7 @@ const MERGABLE_TYPES = new Set([
* Determine if the variable is directly exported
* @param variable the variable to check
*/
functionisMergableExported(variable: ScopeVariable): boolean {
functionisMergeableExported(variable: ScopeVariable): boolean {
// If all of the merged things are of the same type, TS will error if not all of them are exported - so we only need to find one
for (const def of variable.defs) {
// parameters can never be exported.
Expand All@@ -437,7 +437,7 @@ function isMergableExported(variable: ScopeVariable): boolean {
}

if (
(MERGABLE_TYPES.has(def.node.type) &&
(MERGEABLE_TYPES.has(def.node.type) &&
def.node.parent.type === AST_NODE_TYPES.ExportNamedDeclaration) ||
def.node.parent.type === AST_NODE_TYPES.ExportDefaultDeclaration
) {
Expand Down
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -251,7 +251,7 @@ var bar: string = function (): string {
},
{
code: `
var bar: string = function (arg1:stirng): string {
var bar: string = function (arg1:string): string {
return 'string';
};
`,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2058,7 +2058,7 @@ ruleTester.run('naming-convention', rule, {
'enumMember',
],
},
// making sure the `requoresQuotes` modifier appropriately overrides this
// making sure the `requiresQuotes` modifier appropriately overrides this
{
format: ['PascalCase'],
selector: [
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,7 +146,7 @@ if (returnsPromise?.call()) {
`,
'Promise.resolve() ?? false;',
`
function test(a: Promise<void> |undefinded) {
function test(a: Promise<void> |undefined) {
const foo = a ?? Promise.reject();
}
`,
Expand Down
2 changes: 1 addition & 1 deletionpackages/eslint-plugin/tests/util/misc.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -65,7 +65,7 @@ describe(misc.findLastIndex, () => {
expect(misc.findLastIndex([1, 2, 3], () => true)).toBe(2);
});

it('returns the index of the lastoccurance of a duplicate element', () => {
it('returns the index of the lastoccurrence of a duplicate element', () => {
expect(misc.findLastIndex([1, 2, 3, 3, 5], n => n === 3)).toBe(3);
});
});
6 changes: 3 additions & 3 deletionspackages/rule-tester/tests/RuleTester.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -965,7 +965,7 @@ describe(RuleTester, () => {
});

describe('constructor constraints', () => {
it('skips all tests if a constructor constraint is notsatisifed', () => {
it('skips all tests if a constructor constraint is notsatisfied', () => {
satisfiesAllDependencyConstraintsMock.mockReturnValueOnce(false);
const ruleTester = new RuleTester({
dependencyConstraints: {
Expand DownExpand Up@@ -998,7 +998,7 @@ describe(RuleTester, () => {
`);
});

it('does not skip all tests if a constructor constraint issatisifed', () => {
it('does not skip all tests if a constructor constraint issatisfied', () => {
satisfiesAllDependencyConstraintsMock.mockReturnValueOnce(true);
const ruleTester = new RuleTester({
dependencyConstraints: {
Expand DownExpand Up@@ -1646,7 +1646,7 @@ describe('RuleTester - run types', () => {
};

describe('infer from `rule` parameter', () => {
it('should correctly infer `options` or `messageIds` types from the `rule`paramter', () => {
it('should correctly infer `options` or `messageIds` types from the `rule`parameter', () => {
expect(() =>
ruleTester.run('my-rule', ruleModule, {
invalid: [],
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,7 +27,7 @@ describe('ES6 block scope', () => {
expect(scope.references[1].identifier.name).toBe('i');
});

it('functiondelaration is materialized in ES6 block scope', () => {
it('functiondeclaration is materialized in ES6 block scope', () => {
const { scopeManager } = parseAndAnalyze(`
{
function test() {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types';
import{DefinitionType,ScopeType}from'../../src/index.js';
import{getRealVariables,parseAndAnalyze}from'../test-utils/index.js';

describe('gloablReturn option',()=>{
describe('globalReturn option',()=>{
it('creates a function scope following the global scope immediately',()=>{
const{ scopeManager}=parseAndAnalyze(
`
Expand Down
4 changes: 2 additions & 2 deletionspackages/type-utils/tests/requiresQuoting.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,12 +14,12 @@ describe(requiresQuoting, () => {
expect(result).toBe(false);
});

it('start withdollorSign', () => {
it('start withdollarSign', () => {
const name = '$bar';
const result = requiresQuoting(name);
expect(result).toBe(false);
});
it('includedollorSign not start position', () => {
it('includedollarSign not start position', () => {
const name = 'foo$bar';
const result = requiresQuoting(name);
expect(result).toBe(false);
Expand Down
2 changes: 1 addition & 1 deletionpackages/typescript-eslint/src/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,7 +30,7 @@ require('typescript-eslint').plugin !== require('@typescript-eslint/eslint-plugi
This is bad because it means that 3rd party configs would be required to use
`typescript-eslint` or else they would break a user's config if the user either
used `tseslint.configs.recomended` et al or
used `tseslint.configs.recommended` et al or
```
{
plugins: {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ describe('semanticInfo - singleRun', () => {
expect(createProgramFromConfigFile).not.toHaveBeenCalled();
});

it('should not create any programs ahead of time when when TSESTREE_SINGLE_RUN=false, even if otherinferrence criteria apply', () => {
it('should not create any programs ahead of time when when TSESTREE_SINGLE_RUN=false, even if otherinference criteria apply', () => {
vi.stubEnv('TSESTREE_SINGLE_RUN', 'false');

// Normally CI=true would be used to infer singleRun=true, but TSESTREE_SINGLE_RUN is explicitly set to false
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp