diff --git a/packages/bundled-eslint-config/src/setup/for-astro.ts b/packages/bundled-eslint-config/src/setup/for-astro.ts index b4d6ea69..c7f1c2ba 100644 --- a/packages/bundled-eslint-config/src/setup/for-astro.ts +++ b/packages/bundled-eslint-config/src/setup/for-astro.ts @@ -8,7 +8,13 @@ import type { Globals, Plugins, LanguageOptions, Rules, Settings } from '../util export const astroSettings: Settings = {} +export const astroGlobals: Globals = { + Astro: false, + Fragment: false +} + export const astroLanguageOptions: LanguageOptions = { + globals: astroGlobals, parser, parserOptions: { ecmaVersion: 2023, @@ -21,11 +27,6 @@ export const astroLanguageOptions: LanguageOptions = { } } -export const astroGlobals: Globals = { - Astro: false, - Fragment: false -} - export const astroPlugins: Plugins = { astro: eslintPluginAstro } diff --git a/packages/bundled-eslint-config/src/setup/for-js.ts b/packages/bundled-eslint-config/src/setup/for-js.ts index 5e898520..6aab3db4 100644 --- a/packages/bundled-eslint-config/src/setup/for-js.ts +++ b/packages/bundled-eslint-config/src/setup/for-js.ts @@ -41,7 +41,12 @@ export const jsSettings: Settings = { }*/ } +export const jsGlobals: Globals = { + ...globals.es2021 +} + export const jsLanguageOptions: LanguageOptions = { + globals: jsGlobals, parserOptions: { ecmaVersion: 2023, sourceType: 'module', @@ -51,16 +56,11 @@ export const jsLanguageOptions: LanguageOptions = { } } -export const jsGlobals: Globals = { - ...globals.es2021 -} - export const jsPlugins: Plugins = { '@brettz9': brettz9EslintPlugin, 'case-police': eslintPluginCasePolice, import: eslintPluginImport, jsdoc: eslintPluginJsdoc, - pii: eslintPluginPii, promise: eslintPluginPromise, security: eslintPluginSecurity, unicorn: eslintPluginUnicorn diff --git a/packages/bundled-eslint-config/src/setup/for-node.ts b/packages/bundled-eslint-config/src/setup/for-node.ts index de0eef2f..bd81bbce 100644 --- a/packages/bundled-eslint-config/src/setup/for-node.ts +++ b/packages/bundled-eslint-config/src/setup/for-node.ts @@ -4,12 +4,14 @@ import type { Globals, LanguageOptions, Plugins, Rules, Settings } from '../util export const nodeSettings: Settings = {} -export const nodeLanguageOptions: LanguageOptions = {} - export const nodeGlobals: Globals = { ...globals.node } +export const nodeLanguageOptions: LanguageOptions = { + globals: nodeGlobals +} + export const nodePlugins: Plugins = {} export const nodeRules: Rules = { diff --git a/packages/bundled-eslint-config/src/setup/for-react-native.ts b/packages/bundled-eslint-config/src/setup/for-react-native.ts index 62a72a5d..3b7213e4 100644 --- a/packages/bundled-eslint-config/src/setup/for-react-native.ts +++ b/packages/bundled-eslint-config/src/setup/for-react-native.ts @@ -4,10 +4,12 @@ import type { Globals, LanguageOptions, Plugins, Rules, Settings } from '../util export const reactNativeSettings: Settings = {} -export const reactNativeLanguageOptions: LanguageOptions = {} - export const reactNativeGlobals: Globals = {} +export const reactNativeLanguageOptions: LanguageOptions = { + globals: reactNativeGlobals +} + export const reactNativePlugins: Plugins = { 'react-native': eslintPluginReactNative } diff --git a/packages/bundled-eslint-config/src/setup/for-react.ts b/packages/bundled-eslint-config/src/setup/for-react.ts index c9541b3c..6bde4d0b 100644 --- a/packages/bundled-eslint-config/src/setup/for-react.ts +++ b/packages/bundled-eslint-config/src/setup/for-react.ts @@ -6,10 +6,12 @@ import type { Globals, LanguageOptions, Plugins, Rules, Settings } from '../util export const reactSettings: Settings = {} -export const reactLanguageOptions: LanguageOptions = {} - export const reactGlobals: Globals = {} +export const reactLanguageOptions: LanguageOptions = { + globals: reactGlobals +} + export const reactPlugins: Plugins = { react: eslintPluginReact, 'react-hooks': eslintPluginReactHooks, diff --git a/packages/bundled-eslint-config/src/setup/for-ts.ts b/packages/bundled-eslint-config/src/setup/for-ts.ts index 8d5e7453..59b4ffe7 100644 --- a/packages/bundled-eslint-config/src/setup/for-ts.ts +++ b/packages/bundled-eslint-config/src/setup/for-ts.ts @@ -20,7 +20,10 @@ export const tsSettings: Settings = { ] } +export const tsGlobals: Globals = {} + export const tsLanguageOptions: LanguageOptions = { + globals: tsGlobals, parser, parserOptions: { ecmaVersion: 2023, @@ -32,8 +35,6 @@ export const tsLanguageOptions: LanguageOptions = { } } -export const tsGlobals: Globals = {} - export const tsPlugins: Plugins = { '@typescript-eslint': typescriptEslintPlugin } diff --git a/packages/bundled-eslint-config/src/setup/for-vitest.ts b/packages/bundled-eslint-config/src/setup/for-vitest.ts index 114e786a..b6d10cc6 100644 --- a/packages/bundled-eslint-config/src/setup/for-vitest.ts +++ b/packages/bundled-eslint-config/src/setup/for-vitest.ts @@ -4,10 +4,12 @@ import type { Globals, LanguageOptions, Plugins, Rules, Settings } from '../util export const vitestSettings: Settings = {} -export const vitestLanguageOptions: LanguageOptions = {} - export const vitestGlobals: Globals = {} +export const vitestLanguageOptions: LanguageOptions = { + globals: vitestGlobals +} + export const vitestPlugins: Plugins = { vitest: eslintPluginVitest } diff --git a/packages/bundled-eslint-config/src/setup/for-vue.ts b/packages/bundled-eslint-config/src/setup/for-vue.ts index dbf98693..ec7783ae 100644 --- a/packages/bundled-eslint-config/src/setup/for-vue.ts +++ b/packages/bundled-eslint-config/src/setup/for-vue.ts @@ -7,7 +7,10 @@ import type { Globals, LanguageOptions, Plugins, Rules, Settings } from '../util export const vueSettings: Settings = {} +export const vueGlobals: Globals = {} + export const vueLanguageOptions: LanguageOptions = { + globals: vueGlobals, parser: vueEslintParser, parserOptions: { ecmaFeatures: { jsx: true }, @@ -18,8 +21,6 @@ export const vueLanguageOptions: LanguageOptions = { } } -export const vueGlobals: Globals = {} - export const vuePlugins: Plugins = { vue: eslintPluginVue } diff --git a/packages/bundled-eslint-config/src/setup/for-workers.ts b/packages/bundled-eslint-config/src/setup/for-workers.ts index b96b6efd..ef796d2b 100644 --- a/packages/bundled-eslint-config/src/setup/for-workers.ts +++ b/packages/bundled-eslint-config/src/setup/for-workers.ts @@ -5,12 +5,14 @@ import type { Globals, LanguageOptions, Plugins, Rules, Settings } from '../util export const workersSettings: Settings = {} -export const workersLanguageOptions: LanguageOptions = {} - export const workersGlobals: Globals = { ...globals['shared-node-browser'] } +export const workersLanguageOptions: LanguageOptions = { + globals: workersGlobals +} + export const workersPlugins: Plugins = {} export const workersRules: Rules = { diff --git a/prepublish.js b/prepublish.js index 083e37b4..59e64e5f 100644 --- a/prepublish.js +++ b/prepublish.js @@ -28,7 +28,7 @@ const packageJsonJobs = { }, 'packages/bundled-eslint-config': { type: 'module', - version: '0.1.6', + version: '0.2.0', description: 'A preset for ESLint', keywords: [ 'eslint',