Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f32377f
commit d35eaaf
Showing
3 changed files
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
eslint/babel-eslint-tests/test/integration/eslint/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import eslint from "eslint"; | ||
import * as parser from "@babel/eslint-parser"; | ||
|
||
describe("ESLint config", () => { | ||
it('should set ecmaVersion to latest and sourceType to "module" by default', () => { | ||
const linter = new eslint.Linter(); | ||
linter.defineParser("@babel/eslint-parser", parser); | ||
// ImportDeclarations result in a parser error if ecmaVersion < 2015 and sourceType != "module". | ||
const messages = linter.verify('import { hello } from "greetings"', { | ||
parser: "@babel/eslint-parser", | ||
parserOptions: { | ||
babelOptions: { | ||
configFile: require.resolve( | ||
"../../../../babel-eslint-shared-fixtures/config/babel.config.js", | ||
), | ||
}, | ||
}, | ||
}); | ||
expect(messages.length).toEqual(0); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters