File tree Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
22const eslintrc = require ( '@eslint/eslintrc' ) ;
3- const legacyConfigBase = require ( './legacy-config-base.js' ) ;
4-
5- const {
6- parserOptions : {
7- ecmaVersion,
8- sourceType,
9- } ,
10- } = legacyConfigBase ;
113
124const { globals} = eslintrc . Legacy . environments . get ( 'es2024' ) ;
135
146module . exports = {
157 languageOptions : {
16- ecmaVersion,
17- sourceType,
188 globals,
199 } ,
2010} ;
Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ import * as eslintrc from '@eslint/eslintrc';
3232export default [
3333 {
3434 languageOptions: {
35- ecmaVersion: ' latest' ,
36- sourceType: ' module' ,
3735 globals: eslintrc .Legacy .environments .get (' es2024' ),
3836 },
3937 plugins: {
@@ -58,8 +56,6 @@ const eslintrc = require('@eslint/eslintrc');
5856module .exports = [
5957 {
6058 languageOptions: {
61- ecmaVersion: ' latest' ,
62- sourceType: ' module' ,
6359 globals: eslintrc .Legacy .environments .get (' es2024' ),
6460 },
6561 plugins: {
Original file line number Diff line number Diff line change @@ -228,7 +228,12 @@ function getCompactConfig(config) {
228228 for ( const part of compat . config ( config ) ) {
229229 for ( const [ key , value ] of Object . entries ( part ) ) {
230230 if ( key === 'languageOptions' ) {
231- result [ key ] = { ...result [ key ] , ...value } ;
231+ const languageOptions = { ...result [ key ] , ...value } ;
232+ // ESLint uses same `ecmaVersion` and `sourceType` as we recommended in the new configuration system
233+ // https://eslint.org/docs/latest/use/configure/configuration-files-new#configuration-objects
234+ delete languageOptions . ecmaVersion ;
235+ delete languageOptions . sourceType ;
236+ result [ key ] = languageOptions ;
232237 } else if ( key === 'plugins' ) {
233238 result [ key ] = undefined ;
234239 } else {
You can’t perform that action at this time.
0 commit comments