Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(eslint): lint examples #1033

Merged
merged 1 commit into from
Sep 1, 2024
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
11 changes: 10 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';

export default tseslint.config(
// replacement of legacy `.eslintignore`
Expand All @@ -13,8 +14,16 @@ export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
eslintPluginPrettierRecommended,
// base config
{
files: ['*.js'],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
files: ['**/*.js'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"install:all": "yarn && (cd examples && yarn)",
"lint": "yarn prettier && yarn eslint",
"lint:fix": "yarn prettier:fix && yarn eslint:fix",
"eslint": "eslint '{src,test}/**/*.ts' --cache",
"eslint": "eslint '{src,test,examples}/**/*.{js,ts}' --cache",
"eslint:fix": "yarn eslint --fix",
"prettier": "prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"",
"prettier:fix": "prettier --write \"**/*.{js,ts,md,yml,json,html}\"",
Expand Down Expand Up @@ -75,6 +75,7 @@
"eslint-plugin-prettier": "5.2.1",
"express": "4.19.2",
"get-port": "5.1.1",
"globals": "15.9.0",
"husky": "9.1.5",
"jest": "29.7.0",
"lint-staged": "15.2.9",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2663,6 +2663,11 @@ global-directory@^4.0.1:
dependencies:
ini "4.1.1"

globals@15.9.0:
version "15.9.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-15.9.0.tgz#e9de01771091ffbc37db5714dab484f9f69ff399"
integrity sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==

globals@^11.1.0:
version "11.12.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
Expand Down
Loading