Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Commit

Permalink
Add configFile option and fix legacy decorators tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Dec 18, 2018
1 parent f593b63 commit 505a719
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const tt = require("@babel/parser").tokTypes;
module.exports = function(code, options) {
const opts = {
sourceType: options.sourceType,
configFile: options.configFile,
parserOpts: {
allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree
allowReturnOutsideFunction: true,
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/config/babel.config.decorators-legacy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"use strict";

module.exports = {
presets: [["@babel/preset-env", { forceAllTransforms: true }]],
plugins: [["@babel/plugin-proposal-decorators", { legacy: true }]],
};
5 changes: 5 additions & 0 deletions test/specs/non-regression.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use strict";

const eslint = require("eslint");
const path = require("path");
const unpad = require("dedent");

function verifyAndAssertMessagesWithSpecificESLint(
Expand Down Expand Up @@ -1153,6 +1154,10 @@ describe("verify", () => {
const overrideConfig = {
parserOptions: {
sourceType,
configFile: path.resolve(
__dirname,
"../fixtures/config/babel.config.decorators-legacy.js"
),
},
};
return verifyAndAssertMessages(
Expand Down

0 comments on commit 505a719

Please sign in to comment.