Skip to content

Commit

Permalink
make message consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
scripthunter7 committed Sep 9, 2024
1 parent 3294981 commit 4082945
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ It uses the [ECSSTree][ecss-tree] parser internally to check the CSS syntax.
```
will be reported as error:
```txt
1:4 error Cannot parse CSS code as 'selectorList', got error: 'Name is expected'
1:4 error Cannot parse CSS code as 'selectorList', got 'Name is expected'
```
since the class selector (`.`) does not have a class name, like `.foo`.
Also works with CSS injection rules and their declaration lists.
Expand Down
2 changes: 1 addition & 1 deletion src/linter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ export class Linter {
const reportError = (error: Error) => {
const problem: LinterProblemReport = {
// eslint-disable-next-line max-len
message: `Cannot parse CSS code as '${context}', got error: '${getErrorMessage(error)}'`,
message: `Cannot parse CSS code as '${context}', got '${getErrorMessage(error)}'`,
node: rawValueNode,
};

Expand Down
4 changes: 2 additions & 2 deletions test/linter/cli/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('CLI tests', () => {
problems: [
{
severity: 2,
message: "Cannot parse CSS code as 'selectorList', got error: 'Name is expected'",
message: "Cannot parse CSS code as 'selectorList', got 'Name is expected'",
position: {
startLine: 2,
startColumn: 14,
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('CLI tests', () => {
problems: [
{
severity: 2,
message: "Cannot parse CSS code as 'selectorList', got error: 'Name is expected'",
message: "Cannot parse CSS code as 'selectorList', got 'Name is expected'",
position: {
startLine: 2,
startColumn: 14,
Expand Down
4 changes: 2 additions & 2 deletions test/linter/rules/no-invalid-css-syntax.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('no-invalid-css-syntax', () => {
{
rule: 'no-invalid-css-syntax',
severity: 2,
message: "Cannot parse CSS code as 'selectorList', got error: 'Identifier is expected'",
message: "Cannot parse CSS code as 'selectorList', got 'Identifier is expected'",
position: {
startLine: 1,
startColumn: 3,
Expand All @@ -56,7 +56,7 @@ describe('no-invalid-css-syntax', () => {
{
rule: 'no-invalid-css-syntax',
severity: 2,
message: "Cannot parse CSS code as 'selectorList', got error: '\")\" is expected'",
message: "Cannot parse CSS code as 'selectorList', got '\")\" is expected'",
position: {
startLine: 2,
startColumn: 11,
Expand Down

0 comments on commit 4082945

Please sign in to comment.