Skip to content

Commit

Permalink
JS-401 Revert change on Babel paths (#4894)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdiez authored Nov 8, 2024
1 parent 0e9590e commit 5de6981
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/jsts/src/parsers/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { Linter } from 'eslint';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';

/**
* Builds ESLint parser options
Expand Down Expand Up @@ -70,14 +72,15 @@ export function buildParserOptions(initialOptions: Linter.ParserOptions, usingBa
* @returns the extend parser options
*/
function babelParserOptions(options: Linter.ParserOptions) {
const pluginPath = `${dirname(fileURLToPath(import.meta.url))}/../../../../node_modules`;
const babelOptions = {
targets: 'defaults',
presets: [
['@babel/preset-react', {}],
['@babel/preset-flow', {}],
['@babel/preset-env', {}],
`${pluginPath}/@babel/preset-react`,
`${pluginPath}/@babel/preset-flow`,
`${pluginPath}/@babel/preset-env`,
],
plugins: [['@babel/plugin-proposal-decorators', { version: '2022-03' }]],
plugins: [[`${pluginPath}/@babel/plugin-proposal-decorators`, { version: '2022-03' }]],
babelrc: false,
configFile: false,
parserOpts: {
Expand Down

0 comments on commit 5de6981

Please sign in to comment.