-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible example
Description
Environment
Node version: v18.18.0
npm version: v9.4.2
Local ESLint version: v9.0.0-alpha.0 (Currently used)
Global ESLint version: Not found
Operating System: linux 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
What parser are you using?
Default (Espree)
What did you do?
Create a file to run RuleTester
import { RuleTester } from 'eslint';
const tester = new RuleTester();
const rule = {
create: (context) => ({
Program(node) {
context.report({ node, message: 'It works' });
},
}),
};
tester.run('rule-id', rule, {
valid: [],
invalid: [
{
code: '_',
filename: '/a-none-exits-file',
errors: [{ message: 'It works' }],
},
],
});
What did you expect to happen?
Should pass.
What actually happened?
Error: Error rule name should be the same as the name of the rule being tested (false == true)
at _0x2e26db._evaluate (https://stackblitzstartersdvpau5-bahv.w-credentialless.staticblitz.com/blitz.a2aabdd9.js:352:376700)
at async ModuleJob.run (https://stackblitzstartersdvpau5-bahv.w-credentialless.staticblitz.com/blitz.a2aabdd9.js:181:2372) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '=='
}
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response
sindresorhus
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible example
Type
Projects
Status
Complete