Skip to content

Commit

Permalink
chore(eslint): lint examples
Browse files Browse the repository at this point in the history
  • Loading branch information
chimurai committed Sep 1, 2024
1 parent c2f912a commit b53f0a6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
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"

[email protected]:
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

0 comments on commit b53f0a6

Please sign in to comment.