Skip to content

Commit bd50bf9

Browse files
committed
feature: @putout/plugin-eslint: remove-parser-options: exclude when has parser property
1 parent 31a64dc commit bd50bf9

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default [{
2+
languageOptions: {
3+
parser: babel,
4+
parserOptions,
5+
}
6+
}];

packages/plugin-eslint/lib/remove-parser-options/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ module.exports.traverse = ({push}) => ({
2424
if (!parserOptionsPath)
2525
return;
2626

27+
const [parserPath] = traverseProperties(languageOptionsPath, 'parser');
28+
29+
if (parserPath)
30+
return false;
31+
2732
const [babelOptionsPath] = traverseProperties(parserOptionsPath, 'babelOptions');
2833
const [ecmaFeatures] = traverseProperties(parserOptionsPath, 'ecmaFeatures');
2934

packages/plugin-eslint/lib/remove-parser-options/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ test('eslint: remove-parser-options: no report: typescript-options', (t) => {
3333
t.noReport('typescript-options');
3434
t.end();
3535
});
36+
37+
test('eslint: remove-parser-options: no report: has-parser', (t) => {
38+
t.noReport('has-parser');
39+
t.end();
40+
});

0 commit comments

Comments
 (0)