Skip to content

Commit

Permalink
⚡ [ci release] Actually add globals
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniFoldi committed Oct 9, 2023
1 parent 52dba42 commit dcac840
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 25 deletions.
11 changes: 6 additions & 5 deletions packages/bundled-eslint-config/src/setup/for-astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -21,11 +27,6 @@ export const astroLanguageOptions: LanguageOptions = {
}
}

export const astroGlobals: Globals = {
Astro: false,
Fragment: false
}

export const astroPlugins: Plugins = {
astro: eslintPluginAstro
}
Expand Down
10 changes: 5 additions & 5 deletions packages/bundled-eslint-config/src/setup/for-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions packages/bundled-eslint-config/src/setup/for-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 4 additions & 2 deletions packages/bundled-eslint-config/src/setup/for-react-native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 4 additions & 2 deletions packages/bundled-eslint-config/src/setup/for-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions packages/bundled-eslint-config/src/setup/for-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const tsSettings: Settings = {
]
}

export const tsGlobals: Globals = {}

export const tsLanguageOptions: LanguageOptions = {
globals: tsGlobals,
parser,
parserOptions: {
ecmaVersion: 2023,
Expand All @@ -32,8 +35,6 @@ export const tsLanguageOptions: LanguageOptions = {
}
}

export const tsGlobals: Globals = {}

export const tsPlugins: Plugins = {
'@typescript-eslint': typescriptEslintPlugin
}
Expand Down
6 changes: 4 additions & 2 deletions packages/bundled-eslint-config/src/setup/for-vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 3 additions & 2 deletions packages/bundled-eslint-config/src/setup/for-vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -18,8 +21,6 @@ export const vueLanguageOptions: LanguageOptions = {
}
}

export const vueGlobals: Globals = {}

export const vuePlugins: Plugins = {
vue: eslintPluginVue
}
Expand Down
6 changes: 4 additions & 2 deletions packages/bundled-eslint-config/src/setup/for-workers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit dcac840

Please sign in to comment.