Closed Bug 1626300 Opened 5 years ago Closed 2 years ago

Formatting xhtml files with prettier / ESLint fails

Categories

(Developer Infrastructure :: Lint and Formatting, task, P3)

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: standard8, Unassigned)

References

(Blocks 1 open bug)

Details

I've just been experimenting with formatting of xhtml files with Prettier.

We get errors running this on at least some xhtml files (running ./mach eslint --fix):

An error occurred running eslint. Please check the following error messages:

Error: Invalid slice indexes
    at TransformableString.replace (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/TransformableString.js:82:13)
    at chunk (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/extract.js:198:25)
    at emitChunk (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/extract.js:94:7)
    at iterateScripts (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/extract.js:105:7)
    at extract (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/extract.js:188:3)
    at Linter.(anonymous function) (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/index.js:159:27)
    at Linter._verifyWithConfigArray (/Users/mark/dev/gecko/node_modules/eslint/lib/linter/linter.js:1255:21)
    at Linter.verify (/Users/mark/dev/gecko/node_modules/eslint/lib/linter/linter.js:1210:25)
    at Linter.verifyAndFix (/Users/mark/dev/gecko/node_modules/eslint/lib/linter/linter.js:1400:29)
    at verifyText (/Users/mark/dev/gecko/node_modules/eslint/lib/cli-engine/cli-engine.js:230:48)

An error occurred running eslint. Please check the following error messages:

Error: Invalid location
    at locationToIndex (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/TransformableString.js:22:11)
    at TransformableString.originalLocation (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/TransformableString.js:121:19)
    at remapMessages (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/index.js:294:31)
    at verifyCodePart (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/index.js:212:12)
    at verifyWithSharedScopes (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/index.js:236:5)
    at Linter.(anonymous function) (/Users/mark/dev/gecko/node_modules/eslint-plugin-html/src/index.js:222:7)
    at Linter._verifyWithConfigArray (/Users/mark/dev/gecko/node_modules/eslint/lib/linter/linter.js:1255:21)
    at Linter.verify (/Users/mark/dev/gecko/node_modules/eslint/lib/linter/linter.js:1210:25)
    at Linter.verifyAndFix (/Users/mark/dev/gecko/node_modules/eslint/lib/linter/linter.js:1400:29)
    at verifyText (/Users/mark/dev/gecko/node_modules/eslint/lib/cli-engine/cli-engine.js:230:48)
Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
Depends on: 1809497

Once bug 1809497 this will be WFM, so I'm closing this early as that's the planned route.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.