Skip to content

Commit 93ba96f

Browse files
committed
chore: ESLint play around.
1 parent 472fd4c commit 93ba96f

6 files changed

+61
-27
lines changed

eslint.config.js

+34-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
11
// @ts-check
22
import eslint from '@eslint/js';
33
import tsParser from '@typescript-eslint/parser';
4+
import esLintConfigPrettier from 'eslint-config-prettier';
5+
import jsdoc from 'eslint-plugin-jsdoc';
46
import { config, configs } from 'typescript-eslint';
57

68
export default config(
7-
eslint.configs.recommended,
8-
...configs.strict,
9-
...configs.stylisticTypeChecked,
10-
...configs.recommendedTypeChecked,
11-
{
12-
// ignores: ['dist/**', 'examples/vanilla/**'],
13-
languageOptions: {
14-
parser: tsParser,
15-
parserOptions: {
16-
project: ['./tsconfig.json'],
17-
sourceType: "module",
18-
tsconfigRootDir: import.meta.dirname,
19-
20-
},
21-
},
22-
}
9+
eslint.configs.recommended,
10+
esLintConfigPrettier,
11+
...configs.strict,
12+
...configs.stylisticTypeChecked,
13+
...configs.recommendedTypeChecked,
14+
configs.eslintRecommended,
15+
{
16+
// ignores: ['dist/**', 'examples/vanilla/**'],
17+
languageOptions: {
18+
parser: tsParser,
19+
parserOptions: {
20+
project: ['./tsconfig.json', 'tsconfig.eslint.json'],
21+
sourceType: 'module',
22+
tsconfigRootDir: import.meta.dirname,
23+
24+
},
25+
},
26+
plugins: {
27+
jsdoc: jsdoc,
28+
},
29+
rules: {
30+
indent: 'error',
31+
quotes: [
32+
'error',
33+
'single',
34+
{ 'avoidEscape': true, 'allowTemplateLiterals': true }
35+
],
36+
'jsdoc/require-jsdoc': 'error',
37+
'jsdoc/check-values': 'error'
38+
39+
}
40+
}
2341
);

index.ts

-1
This file was deleted.

package.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"build": "bun build src/index.ts --outdir ./dist",
1212
"dev": "bun run src/index.ts",
13-
"lint": "bunx --bun eslint --fix -c eslint.config.js",
13+
"lint": "bunx --bun eslint --fix -c eslint.config.js --ignore-pattern 'dist' --ignore-pattern 'examples/vanilla'",
1414
"serve:examples": "bunx http-server . -o ./examples/ -bg"
1515
},
1616
"keywords": [
@@ -32,15 +32,20 @@
3232
"devDependencies": {
3333
"@eslint/js": "^9.3.0",
3434
"@types/bun": "latest",
35+
"@types/eslint-config-prettier": "^6.11.3",
36+
"@types/eslint__js": "",
3537
"eslint": "9.x",
38+
"eslint-config-prettier": "^9.1.0",
3639
"eslint-config-standard": "^17.1.0",
37-
"eslint-plugin-import": "^2.25.2",
38-
"eslint-plugin-promise": "^6.0.0",
40+
"eslint-plugin-jsdoc": "^48.2.6",
3941
"globals": "^15.3.0",
4042
"prettier": "^3.2.5",
4143
"typescript-eslint": "^7.10.0"
4244
},
4345
"peerDependencies": {
4446
"typescript": "^5.0.0"
47+
},
48+
"dependencies": {
49+
"syronjs": "."
4550
}
4651
}

prettier.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/** @type {import("prettier").Config} */
44
export default {
5-
trailingComma: "es5",
5+
trailingComma: 'es5',
66
tabWidth: 8,
77
semi: false,
88
singleQuote: true,

tsconfig.eslint.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
// extend your base config so you don't have to redefine your compilerOptions
3+
"extends": "./tsconfig.json",
4+
"include": [
5+
"packages/**/*.ts",
6+
"__tests__/**/*.ts",
7+
// "typings/**/*.ts",
8+
// etc
9+
// if you have a mixed JS/TS codebase, don't forget to include your JS file
10+
],
11+
"files": ["**/*.js"],
12+
"exclude": ["dist", "examples/vanilla"]
13+
}

tsconfig.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,14 @@
2626
},
2727
"typeRoots": ["node_modules/@types", "@types"],
2828
"include": [
29-
"packages/**/*"
30-
],
31-
"exclude": [
29+
"packages",
3230
"eslint.config.js",
3331
"prettier.config.js",
34-
"vanilla",
32+
"coverage"
33+
],
34+
"exclude": [
3535
"node_modules",
36+
"examples/vanilla",
3637
"dist",
37-
"build",
38-
"coverage"
3938
]
4039
}

0 commit comments

Comments
 (0)