Skip to content
Permalink
Browse files
Chore: add test for merging parserOptions in Linter (#14948)
  • Loading branch information
mdjermanovic committed Aug 23, 2021
1 parent 3d7d5fb commit 2d18db6278320fb97bc8e0bff3518c790566a6a6
Showing 1 changed file with 21 additions and 0 deletions.
@@ -5762,4 +5762,25 @@ var a = "test2";
});
});
});

describe("merging 'parserOptions'", () => {
it("should deeply merge 'parserOptions' from an environment with 'parserOptions' from the provided config", () => {
const code = "return <div/>";
const config = {
env: {
node: true // ecmaFeatures: { globalReturn: true }
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
};

const messages = linter.verify(code, config);

// no parsing errors
assert.strictEqual(messages.length, 0);
});
});
});

0 comments on commit 2d18db6

Please sign in to comment.