Skip to content

Commit 457e08c

Browse files
committed
fix: Fix common misspelling of 'cannot'.
1 parent 106e8ae commit 457e08c

File tree

11 files changed

+22
-22
lines changed

11 files changed

+22
-22
lines changed

packages/@css-blocks/core/src/Analyzer/validations/attribute-group-validator.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function ensureUniqueAttributeGroup(discovered: Set<Attribute>, group: Attribute
1212
let groups = [...group.resolveInheritance(), group];
1313
for (let g of groups) {
1414
if (discovered.has(g)) {
15-
err(`Can not apply multiple states at the same time from the exclusive state group "${g.asSource()}".`);
15+
err(`Cannot apply multiple states at the same time from the exclusive state group "${g.asSource()}".`);
1616
}
1717
if (track) { discovered.add(g); }
1818
}

packages/@css-blocks/core/src/Analyzer/validations/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class TemplateValidator {
8181
this.validators.push(opts[key] as Validator);
8282
}
8383
else if (!VALIDATORS[key]) {
84-
throw new errors.CssBlockError(`Can not find template validator "${key}".`);
84+
throw new errors.CssBlockError(`Cannot find template validator "${key}".`);
8585
}
8686
else if (opts[key] && VALIDATORS[key]) {
8787
this.validators.push(VALIDATORS[key]);

packages/@css-blocks/core/src/BlockParser/features/export-blocks.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function exportBlocks(block: Block, factory: BlockFactory, file: st
5454
for (let remoteName of Object.keys(blockNames)) {
5555
if (remoteNames.has(remoteName)) {
5656
throw new errors.InvalidBlockSyntax(
57-
`Can not have duplicate Block export of same name: "${remoteName}".`,
57+
`Cannot have duplicate Block export of same name: "${remoteName}".`,
5858
sourceRange(factory.configuration, block.stylesheet, file, atRule),
5959
);
6060
}
@@ -79,15 +79,15 @@ export async function exportBlocks(block: Block, factory: BlockFactory, file: st
7979
}
8080
if (remoteName === DEFAULT_EXPORT) {
8181
throw new errors.InvalidBlockSyntax(
82-
`Can not export "${localName}" as reserved word "${DEFAULT_EXPORT}"`,
82+
`Cannot export "${localName}" as reserved word "${remoteName}"`,
8383
sourceRange(factory.configuration, block.stylesheet, file, atRule),
8484
);
8585
}
8686

8787
let referencedBlock = srcBlock.getReferencedBlock(localName);
8888
if (!referencedBlock) {
8989
throw new errors.InvalidBlockSyntax(
90-
`Can not export Block "${localName}". No Block named "${localName}" in "${file}".`,
90+
`Cannot export Block "${localName}". No Block named "${localName}" in "${file}".`,
9191
sourceRange(factory.configuration, block.stylesheet, file, atRule),
9292
);
9393
}

packages/@css-blocks/core/src/BlockParser/features/import-blocks.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export async function importBlocks(block: Block, factory: BlockFactory, file: st
7575
}
7676
if (RESERVED_BLOCK_NAMES.has(localName)) {
7777
throw new errors.InvalidBlockSyntax(
78-
`Can not import "${remoteName}" as reserved word "${localName}"`,
78+
`Cannot import "${remoteName}" as reserved word "${localName}"`,
7979
sourceRange(factory.configuration, block.stylesheet, file, atRule),
8080
);
8181
}
@@ -85,7 +85,7 @@ export async function importBlocks(block: Block, factory: BlockFactory, file: st
8585
let referencedBlock = block.getExportedBlock(remoteName);
8686
if (!referencedBlock) {
8787
throw new errors.InvalidBlockSyntax(
88-
`Can not import Block "${remoteName}". No Block named "${remoteName}" exported by "${blockPath}".`,
88+
`Cannot import Block "${remoteName}". No Block named "${remoteName}" exported by "${blockPath}".`,
8989
sourceRange(factory.configuration, block.stylesheet, file, atRule),
9090
);
9191
}

packages/@css-blocks/core/src/BlockSyntax/BlockPath.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const ERRORS = {
6161
expectsSepInsteadRec: (c: string) => `Expected separator tokens "[" or ".", instead found \`${c}\``,
6262
illegalCharNotInAttribute: (c: string) => `Only attribute selectors may contain the \`${c}\` character.`,
6363
illegalCharInAttribute: (c: string) => `Attribute selectors may not contain the \`${c}\` character.`,
64-
multipleOfType: (t: string) => `Can not have more than one ${t} selector in the same Block path`,
64+
multipleOfType: (t: string) => `Cannot have more than one ${t} selector in the same Block path`,
6565
};
6666

6767
function stringify(tokens: Token[]): string {

packages/@css-blocks/core/src/BlockTree/Block.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class Block
8282
* @prop name string The new uid for this `Block`.
8383
*/
8484
public setName(name: string): void {
85-
if (this.hasHadNameReset) { throw new CssBlockError("Can not set block name more than once."); }
85+
if (this.hasHadNameReset) { throw new CssBlockError("Cannot set block name more than once."); }
8686
this._token = name;
8787
this.hasHadNameReset = true;
8888
}

packages/@css-blocks/core/test/BlockParser/import-export-test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ export class BlockImportExport extends BEMProcessor {
558558

559559
return assertError(
560560
InvalidBlockSyntax,
561-
`Can not import "a" as reserved word "default" (test.css:1:1)`,
561+
`Cannot import "a" as reserved word "default" (test.css:1:1)`,
562562
this.process("test.css", inputCSS, {importer: imports.importer()}),
563563
);
564564
}
@@ -574,7 +574,7 @@ export class BlockImportExport extends BEMProcessor {
574574

575575
return assertError(
576576
InvalidBlockSyntax,
577-
`Can not import "a" as reserved word "html" (test.css:1:1)`,
577+
`Cannot import "a" as reserved word "html" (test.css:1:1)`,
578578
this.process("test.css", inputCSS, {importer: imports.importer()}),
579579
);
580580
}
@@ -590,7 +590,7 @@ export class BlockImportExport extends BEMProcessor {
590590

591591
return assertError(
592592
InvalidBlockSyntax,
593-
`Can not import "default" as reserved word "html" (test.css:1:1)`,
593+
`Cannot import "default" as reserved word "html" (test.css:1:1)`,
594594
this.process("test.css", inputCSS, {importer: imports.importer()}),
595595
);
596596
}
@@ -626,7 +626,7 @@ export class BlockImportExport extends BEMProcessor {
626626

627627
return assertError(
628628
InvalidBlockSyntax,
629-
`Can not export "a" as reserved word "default" (test.css:3:7)`,
629+
`Cannot export "a" as reserved word "default" (test.css:3:7)`,
630630
this.process("test.css", inputCSS, {importer: imports.importer()}),
631631
);
632632
}
@@ -661,7 +661,7 @@ export class BlockImportExport extends BEMProcessor {
661661

662662
return assertError(
663663
InvalidBlockSyntax,
664-
`Can not export Block "nonexistant". No Block named "nonexistant" in "test.css". (test.css:1:1)`,
664+
`Cannot export Block "nonexistant". No Block named "nonexistant" in "test.css". (test.css:1:1)`,
665665
this.process("test.css", inputCSS, {importer: imports.importer()}),
666666
);
667667
}
@@ -677,7 +677,7 @@ export class BlockImportExport extends BEMProcessor {
677677

678678
return assertError(
679679
InvalidBlockSyntax,
680-
`Can not import Block "nonexistant". No Block named "nonexistant" exported by "./a.css". (test.css:1:1)`,
680+
`Cannot import Block "nonexistant". No Block named "nonexistant" exported by "./a.css". (test.css:1:1)`,
681681
this.process("test.css", inputCSS, {importer: imports.importer()}),
682682
);
683683
}

packages/@css-blocks/core/test/validations/attribute-group-validator-test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class TemplateAnalysisTests {
3737
`;
3838
return assertParseError(
3939
cssBlocks.TemplateAnalysisError,
40-
'Can not apply multiple states at the same time from the exclusive state group ":scope[test]". (templates/my-template.hbs:10:32)',
40+
'Cannot apply multiple states at the same time from the exclusive state group ":scope[test]". (templates/my-template.hbs:10:32)',
4141
this.parseBlock(css, "blocks/foo.block.css", config).then(([block, _]) => {
4242
analysis.addBlock("", block);
4343
let element = analysis.startElement({ line: 10, column: 32 });
@@ -62,7 +62,7 @@ export class TemplateAnalysisTests {
6262
`;
6363
return assertParseError(
6464
cssBlocks.TemplateAnalysisError,
65-
'Can not apply multiple states at the same time from the exclusive state group ":scope[test]". (templates/my-template.hbs:10:32)',
65+
'Cannot apply multiple states at the same time from the exclusive state group ":scope[test]". (templates/my-template.hbs:10:32)',
6666
this.parseBlock(css, "blocks/foo.block.css", config).then(([block, _]) => {
6767
analysis.addBlock("", block);
6868
let element = analysis.startElement({ line: 10, column: 32 });
@@ -87,7 +87,7 @@ export class TemplateAnalysisTests {
8787
`;
8888
return assertParseError(
8989
cssBlocks.TemplateAnalysisError,
90-
'Can not apply multiple states at the same time from the exclusive state group ":scope[test]". (templates/my-template.hbs:10:32)',
90+
'Cannot apply multiple states at the same time from the exclusive state group ":scope[test]". (templates/my-template.hbs:10:32)',
9191
this.parseBlock(css, "blocks/foo.block.css", config).then(([block, _]) => {
9292
analysis.addBlock("", block);
9393
let element = analysis.startElement({ line: 10, column: 32 });
@@ -112,7 +112,7 @@ export class TemplateAnalysisTests {
112112
`;
113113
return assertParseError(
114114
cssBlocks.TemplateAnalysisError,
115-
'Can not apply multiple states at the same time from the exclusive state group ":scope[test]". (templates/my-template.hbs:10:32)',
115+
'Cannot apply multiple states at the same time from the exclusive state group ":scope[test]". (templates/my-template.hbs:10:32)',
116116
this.parseBlock(css, "blocks/foo.block.css", config).then(([block, _]) => {
117117
analysis.addBlock("", block);
118118
let element = analysis.startElement({ line: 10, column: 32 });

packages/@css-blocks/jsx/src/utils/ExpressionReader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class ExpressionReader {
129129
else if (token === CALL_START && !this.stateName) {
130130
// XXX This err appears to be completely swallowed?
131131
debug(`Discovered invalid block expression ${this.toString()} in objstr`);
132-
this.err = "Can not select state without a block or class.";
132+
this.err = "Cannot select state without a block or class.";
133133
}
134134
else if (typeof token === "string") {
135135
if (this.stateName) { this.stateValue = token; }

packages/@css-blocks/jsx/test/analyzer/class-states-objstr-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class Test {
149149
).then((_analysis: Analyzer) => {
150150
assert.ok(false, "Should never get here");
151151
}).catch((err) => {
152-
assert.equal(err.message, `[css-blocks] TemplateError: Can not apply multiple states at the same time from the exclusive state group ".pretty[color]". (<unknown file>:11:6)`);
152+
assert.equal(err.message, `[css-blocks] TemplateError: Cannot apply multiple states at the same time from the exclusive state group ".pretty[color]". (<unknown file>:11:6)`);
153153
});
154154
}
155155

packages/@css-blocks/webpack/src/loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function CSSBlocksWebpackAdapter(this: LoaderContext, source: any, map: a
3232

3333
// Make ourselves async. We'll be waiting for Blocks to finish compiling.
3434
let callback = this.async()!;
35-
if (!callback) { throw new Error("Can not initialize CSS Blocks async Webpack loader."); }
35+
if (!callback) { throw new Error("Cannot initialize CSS Blocks async Webpack loader."); }
3636

3737
let thisLoader = this.loaders[this.loaderIndex];
3838
let path = this.resourcePath;

0 commit comments

Comments
 (0)