lukahartwig / eslint-baseline Goto Github PK
View Code? Open in Web Editor NEWRun ESLint with a baseline.
License: MIT License
Run ESLint with a baseline.
License: MIT License
Currently the heuristic for detecting if a lint error is know is a combination of filename, line number, column number, rule id and message content.
Adding a line at the top of a file marks all previously ignored errors as "new" errors because their position has changed.
I'm open for other ideas.
Since this is supposed to be a wrapper around the ESLint CLI it should take the same options and forward them.
According to the readme, I've executed
npx eslint-baseline src
the command above (1st run) generated baseline file.
Then I on purpose change the code so it has an error. Run again
npx eslint-baseline src
and nothing happens. It returns 0
exit code and doesn't display the new error.
When I try to update baseline by
npx eslint-baseline src --update-baseline
the new error is being added. So I suppose something is broken.
Tried to get back to 0.3.2, but it fails with #11
❯ yarn lint:update-baseline
yarn run v1.22.19
$ eslint-baseline --update-baseline .
file:///home/me/Documents/myProject/node_modules/eslint-baseline/node_modules/zod/lib/index.mjs:537
const error = new ZodError(ctx.common.issues);
^
ZodError: [
{
"code": "invalid_type",
"expected": "object",
"received": "array",
"path": [],
"message": "Expected object, received array"
}
]
at get error [as error] (file:///home/me/Documents/myProject/node_modules/eslint-baseline/node_modules/zod/lib/index.mjs:537:31)
at ZodObject.parse (file:///home/me/Documents/myProject/node_modules/eslint-baseline/node_modules/zod/lib/index.mjs:636:22)
at Object.deserialize (file:///home/me/Documents/myProject/node_modules/eslint-baseline/dist/baseline/serialize.js:53:30)
at Processor.handleBaselineExists (file:///home/me/Documents/myProject/node_modules/eslint-baseline/dist/processor.js:23:36)
at Processor.process (file:///home/me/Documents/myProject/node_modules/eslint-baseline/dist/processor.js:16:25)
at Object.handler (file:///home/me/Documents/myProject/node_modules/eslint-baseline/dist/cli.js:41:44)
at async Object.run (/home/me/Documents/myProject/node_modules/cmd-ts/dist/cjs/command.js:154:30)
at async runSafely (/home/me/Documents/myProject/node_modules/cmd-ts/dist/cjs/runner.js:26:24)
at async run (/home/me/Documents/myProject/node_modules/cmd-ts/dist/cjs/runner.js:10:20)
at async file:///home/me/Documents/myProject/node_modules/eslint-baseline/dist/cli.js:52:1 {
issues: [
{
code: 'invalid_type',
expected: 'object',
received: 'array',
path: [],
message: 'Expected object, received array'
}
],
addIssue: [Function (anonymous)],
addIssues: [Function (anonymous)],
errors: [
{
code: 'invalid_type',
expected: 'object',
received: 'array',
path: [],
message: 'Expected object, received array'
}
]
}
Node.js v18.13.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Instead of just relying on the ESLint report we could enhance the output with information from the baseline.
Examples:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.