Skip to content
Merged
Show file tree
Hide file tree
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
68 changes: 32 additions & 36 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default defineConfig([{
extends: compat.extends('eslint:recommended'),
import stylistic from '@stylistic/eslint-plugin';
import globals from 'globals';

languageOptions: {
globals: {
...globals.browser,
...globals.commonjs,
...globals.es2015,
...globals.node,
...globals.mocha,
export default defineConfig([
js.configs.recommended,
{
plugins: {
'@stylistic': stylistic,
},
languageOptions: {
globals: {
...globals.browser,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Given this project's name is snippets-node, it seems to be a Node.js project. Including browser-specific globals might not be necessary and could hide potential errors (e.g., accidental usage of window or document). Consider removing ...globals.browser for stricter linting, unless you have browser-targeted code in this project.

Suggested change
...globals.browser,
// ...globals.browser,

...globals.commonjs,
...globals.es2017,
...globals.node,
...globals.mocha,
},
ecmaVersion: 2017,
sourceType: 'module',
},
rules: {
'no-console': 'off',
'no-unused-vars': 'off',
'@stylistic/linebreak-style': ['error', 'unix'],
'@stylistic/quotes': ['error', 'single'],
'@stylistic/semi': ['error', 'always'],
},

ecmaVersion: 8,
sourceType: 'module',
},

ignores: ['**/eslint.config.*'],

rules: {
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'no-console': 0,
'no-unused-vars': 0,
},
}]);
{
files: ['**/eslint.config.*'],
languageOptions: {
ecmaVersion: 2021, // Node 18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Node 18 has full support for ECMAScript 2022. It would be more accurate to set ecmaVersion to 2022 to allow for modern syntax features in your configuration file.

Suggested change
ecmaVersion: 2021, // Node 18
ecmaVersion: 2022, // Node 18

}
}
]);
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
"lint": "eslint ."
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.5",
"@eslint/js": "9.39.4",
"@stylistic/eslint-plugin": "^5.10.0",
"@types/node": "^24.10.0",
"eslint": "^9.39.4",
"eslint-config-google": "^0.14.0",
"firebase-tools": "^14.24.0",
"globals": "^17.4.0",
"pnpm": "^10.20.0",
Expand Down
86 changes: 49 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading