Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Aug 18, 2020
1 parent f32377f commit d35eaaf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
3 changes: 2 additions & 1 deletion eslint/babel-eslint-tests/package.json
Expand Up @@ -4,7 +4,8 @@
"description": "Tests for babel/eslint-* packages",
"license": "MIT",
"private": true,
"devDependencies": {
"dependencies": {
"@babel/eslint-parser": "^7.11.0",
"dedent": "^0.7.0",
"eslint": "^7.5.0",
"eslint-plugin-import": "^2.22.0"
Expand Down
21 changes: 21 additions & 0 deletions eslint/babel-eslint-tests/test/integration/eslint/config.js
@@ -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);
});
});
@@ -1,5 +1,3 @@
import eslint from "eslint";
import * as parser from "../../../../babel-eslint-parser";
import verifyAndAssertMessages from "../../helpers/verifyAndAssertMessages";

describe("verify", () => {
Expand Down Expand Up @@ -1917,23 +1915,3 @@ describe("verify", () => {
);
});
});

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);
});
});

0 comments on commit d35eaaf

Please sign in to comment.