From c055419ce17780a4b085a45e53e17c7831d3ac8c Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 6 Apr 2024 17:58:44 -0400 Subject: [PATCH] Why --- .github/workflows/test.yml | 2 +- eslint.config.js | 6 +++++- package.json | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81770ea5..60f37f7f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: run: npm install eslint@9 - name: Install ESLint Configs and Plugins - run: npm install @eslint/js@9 eslint-config-amber eslint-plugin-jsonc + run: npm install @eslint/js@9 globals eslint-config-amber eslint-plugin-jsonc - name: Run ESLint run: npm test diff --git a/eslint.config.js b/eslint.config.js index 6edd5ad7..5aaa9c0a 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,12 +1,16 @@ const { default: eslintPluginJsonc } = require('eslint-plugin-jsonc'); const js = require('@eslint/js'); const amber = require('eslint-config-amber'); +const globals = require('globals'); module.exports = [ ...eslintPluginJsonc.configs['flat/recommended-with-json'], { files: ['**/*.js'], - languageOptions: { sourceType: 'commonjs' }, + languageOptions: { + sourceType: 'commonjs', + globals: { ...globals.node } + }, rules: { ...js.configs.recommended.rules, ...amber.rules diff --git a/package.json b/package.json index 73098924..7ce59ae7 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ "@eslint/js": "^9.0.0", "eslint": "^9.0.0", "eslint-config-amber": "^2.0.4", - "eslint-plugin-jsonc": "^2.15.0" + "eslint-plugin-jsonc": "^2.15.0", + "globals": "^15.0.0" } }