Skip to content

Commit 0e7411c

Browse files
committed
Update packages and improve repository setup
1 parent 8701e5a commit 0e7411c

File tree

14 files changed

+3607
-2292
lines changed

14 files changed

+3607
-2292
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 11 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to the library will be documented in this file.
44

55
## vX.X.X (Month DD, YYYY)
66

7+
- Change `FormDataEntry` and `FormDataInfo` from type to interface
78
- Fix potential prototype pollution by ignoring certain keys
89

910
## v0.8.0 (August 20, 2024)

eslint.config.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import eslint from '@eslint/js';
2+
import importPlugin from 'eslint-plugin-import';
3+
import jsdoc from 'eslint-plugin-jsdoc';
4+
import pluginSecurity from 'eslint-plugin-security';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
eslint.configs.recommended,
9+
tseslint.configs.strict,
10+
tseslint.configs.stylistic,
11+
jsdoc.configs['flat/recommended'],
12+
pluginSecurity.configs.recommended,
13+
{
14+
files: ['src/**/*.ts'],
15+
extends: [importPlugin.flatConfigs.recommended],
16+
plugins: { jsdoc },
17+
rules: {
18+
// Enable rules -----------------------------------------------------------
19+
20+
// TypeScript
21+
'@typescript-eslint/consistent-type-definitions': 'error', // Enforce declaring types using `interface` keyword for better TS performance.
22+
'@typescript-eslint/consistent-type-imports': 'warn',
23+
24+
// Import
25+
'import/extensions': ['error', 'always'], // Require file extensions
26+
27+
// JSDoc
28+
'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }],
29+
'jsdoc/sort-tags': [
30+
'error',
31+
{
32+
linesBetween: 1,
33+
tagSequence: [
34+
{ tags: ['deprecated'] },
35+
{ tags: ['param'] },
36+
{ tags: ['returns'] },
37+
],
38+
},
39+
],
40+
// NOTE: For overloads functions, we only require a JSDoc at the top
41+
// SEE: https://github.com/gajus/eslint-plugin-jsdoc/issues/666
42+
'jsdoc/require-jsdoc': [
43+
'error',
44+
{
45+
contexts: [
46+
'ExportNamedDeclaration[declaration.type="TSDeclareFunction"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="TSDeclareFunction"])',
47+
'ExportNamedDeclaration[declaration.type="FunctionDeclaration"]:not(ExportNamedDeclaration[declaration.type="TSDeclareFunction"] + ExportNamedDeclaration[declaration.type="FunctionDeclaration"])',
48+
],
49+
require: {
50+
FunctionDeclaration: false,
51+
},
52+
},
53+
],
54+
55+
// Disable rules ----------------------------------------------------------
56+
57+
// TypeScript
58+
'@typescript-eslint/ban-ts-comment': 'off',
59+
'@typescript-eslint/no-non-null-assertion': 'off',
60+
'@typescript-eslint/no-explicit-any': 'off',
61+
'@typescript-eslint/no-inferrable-types': 'off',
62+
63+
// Imports
64+
'no-duplicate-imports': 'off',
65+
66+
// JSDoc
67+
'jsdoc/require-param-type': 'off',
68+
'jsdoc/require-returns-type': 'off',
69+
70+
// Security
71+
'security/detect-object-injection': 'off', // Too many false positives
72+
},
73+
}
74+
);

package.json

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,27 @@
4242
"scripts": {
4343
"test": "vitest",
4444
"coverage": "vitest run --coverage",
45-
"lint": "eslint \"src/**/*.ts*\" && tsc --noEmit",
45+
"lint": "eslint \"src/**/*.ts*\" && tsc --noEmit && deno check ./src/index.ts",
4646
"format": "prettier --write ./src",
4747
"format.check": "prettier --check ./src",
4848
"build": "tsup"
4949
},
5050
"devDependencies": {
51-
"@types/eslint": "^8.44.3",
52-
"@typescript-eslint/eslint-plugin": "^6.7.4",
53-
"@typescript-eslint/parser": "^6.7.4",
54-
"@vitest/coverage-v8": "^0.34.6",
55-
"eslint": "^8.50.0",
56-
"eslint-plugin-import": "^2.28.1",
57-
"jsdom": "^22.1.0",
58-
"prettier": "^3.0.3",
59-
"tsup": "^7.2.0",
60-
"typescript": "^5.2.2",
61-
"vite": "^4.4.10",
62-
"vitest": "^0.34.6"
51+
"@eslint/js": "^9.23.0",
52+
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
53+
"@types/node": "^22.13.13",
54+
"@vitest/coverage-v8": "^3.0.9",
55+
"eslint": "^9.23.0",
56+
"eslint-plugin-import": "^2.31.0",
57+
"eslint-plugin-jsdoc": "^50.6.9",
58+
"eslint-plugin-security": "^3.0.1",
59+
"jsdom": "^26.0.0",
60+
"prettier": "^3.5.3",
61+
"tsup": "^8.4.0",
62+
"typescript": "^5.8.2",
63+
"typescript-eslint": "^8.28.0",
64+
"vite": "^6.2.3",
65+
"vite-tsconfig-paths": "^5.1.4",
66+
"vitest": "3.0.9"
6367
}
6468
}

0 commit comments

Comments
 (0)