-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Closed
Copy link
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 incorrectlycoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and features
Description
Since eslint 6, rule tester prints newline in codes as \u000a
. It is hard to read for plugin developers.
Code to repoduce
npx mocha index.js
// index.js
const {RuleTester} = require('eslint');
const someRule = {
create() {
return {};
},
};
const ruleTester = new RuleTester();
ruleTester.run('some-rule', someRule, {
valid: [],
invalid: [
{
code: `
var a;
var b;
`,
errors: [{message: 'foooooooooooo'}],
},
],
});
Actual output
Note the lines with \u000a
.
0 passing (46ms)
1 failing
1) some-rule
invalid
\u000a var a;\u000a var b;\u000a :
AssertionError [ERR_ASSERTION]: Should have 1 error but had 0: []
+ expected - actual
-0
+1
Expected ouput
This is the behavior with npm i eslint@5
.
1) some-rule
invalid
var a;
var b;
:
AssertionError [ERR_ASSERTION]: Should have 1 error but had 0: []
+ expected - actual
-0
+1
ulrichb
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 incorrectlycoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and features