Giter Club home page Giter Club logo

eslint-baseline's People

Contributors

github-actions[bot] avatar lukahartwig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

eslint-baseline's Issues

Better heuristic for detecting the same lint error between baselines

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.

Possible Solutions

  1. Leverage git history to figure out at what location a lint error might have been at the time the baseline was created.
  2. Hash the source code, rule id and message for a lint error. Might still have false positives for edge cases but could drastically improve the experience.
  3. ???

I'm open for other ideas.

Missing ESLint options

Since this is supposed to be a wrapper around the ESLint CLI it should take the same options and forward them.

The second run of `eslint-baseline` doesn't show errors

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

Fails to create baseline with error

❯ 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.

Enhance ESLint output with baseline information

Instead of just relying on the ESLint report we could enhance the output with information from the baseline.

Examples:

  • How many errors where ignored?
  • How many errors are in the baseline but not in the project anymore?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.