Skip to content

Commit

Permalink
eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslav-ilin committed Jun 13, 2024
1 parent ba7dbf9 commit d954255
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ lib/maxmind :
.PHONY : fmt
fmt :
bun x prettier --write .
bun x eslint --fix .
@ git diff-index --quiet HEAD

.PHONY : test
Expand Down
30 changes: 30 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// @ts-check

import fs from 'node:fs';

import { eslint, typescript, spec } from 'eslint-config-nilfalse';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['eslint.config.js'].concat(
fs.readFileSync('.gitignore', 'utf8').split('\n').filter(Boolean),
),
},
{
settings: {
'import/core-modules': ['bun:test'],
},
},

...eslint,

{
files: ['**/*.ts', '**/*.tsx', '**/*.mts'],
...typescript,
},
{
files: ['**/*.spec.ts', '**/*.spec.tsx'],
...spec,
},
);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"devDependencies": {
"@types/bun": "latest",
"eslint-config-nilfalse": "github:nilfalse/eslint",
"prettier": "^3.3.1",
"webpack-cli": "^5.1.4"
},
Expand Down

0 comments on commit d954255

Please sign in to comment.