Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS-401 Revert change on Babel paths #4894

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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