Skip to content

Commit ce4923c

Browse files
authored
Integrate tsec into the linting process (vercel#33746)
* Integrate tsec into the linting process * Update tsec-exemptions.json
1 parent ae2d901 commit ce4923c

8 files changed

Lines changed: 45 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
"tailwindcss": "1.1.3",
164164
"taskr": "1.1.0",
165165
"tree-kill": "1.2.2",
166+
"tsec": "0.2.1",
166167
"turbo": "1.0.28",
167168
"typescript": "4.4.3",
168169
"wait-port": "0.2.2",

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"release": "taskr release",
6060
"prepublish": "npm run release && yarn types",
6161
"types": "tsc --declaration --emitDeclarationOnly --declarationDir dist",
62-
"typescript": "tsc --noEmit --declaration",
62+
"typescript": "tsec --noEmit",
6363
"ncc-compiled": "ncc cache clean && taskr ncc"
6464
},
6565
"taskr": {

packages/next/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"extends": "../../tsconfig-tsec.json",
23
"compilerOptions": {
34
"strict": true,
45
"module": "esnext",

packages/react-dev-overlay/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"license": "MIT",
1414
"scripts": {
1515
"prepublish": "tsc -d -p tsconfig.json",
16-
"dev": "tsc -d -w -p tsconfig.json"
16+
"dev": "tsc -d -w -p tsconfig.json",
17+
"typescript": "tsec --noEmit -p tsconfig.json"
1718
},
1819
"dependencies": {
1920
"@babel/code-frame": "7.12.11",

packages/react-dev-overlay/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"extends": "../../tsconfig-tsec.json",
23
"compilerOptions": {
34
"sourceMap": true,
45
"strict": true,

tsconfig-tsec.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"plugins": [
4+
{
5+
"name": "tsec",
6+
"exemptionConfig": "./tsec-exemptions.json"
7+
}
8+
]
9+
}
10+
}

tsec-exemptions.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"ban-element-innerhtml-assignments": [
3+
"packages/next/client/head-manager.ts",
4+
"packages/next/client/script.tsx",
5+
"packages/react-dev-overlay/src/internal/components/Overlay/maintain--tab-focus.ts"
6+
],
7+
"ban-element-setattribute": [
8+
"packages/next/client/head-manager.ts",
9+
"packages/next/client/script.tsx"
10+
],
11+
"ban-script-content-assignments": ["packages/next/client/script.tsx"],
12+
"ban-script-src-assignments": [
13+
"packages/next/client/route-loader.ts",
14+
"packages/next/client/script.tsx"
15+
],
16+
"ban-window-stringfunctiondef": [
17+
"packages/next/lib/recursive-delete.ts",
18+
"packages/next/client/dev/fouc.ts"
19+
]
20+
}

yarn.lock

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14603,7 +14603,7 @@ minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
1460314603
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
1460414604
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
1460514605

14606-
minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4, minimatch@~3.0.2:
14606+
minimatch@3.0.4, minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2:
1460714607
version "3.0.4"
1460814608
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
1460914609
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
@@ -20142,6 +20142,14 @@ tsconfig-paths@^3.9.0:
2014220142
minimist "^1.2.0"
2014320143
strip-bom "^3.0.0"
2014420144

20145+
tsec@0.2.1:
20146+
version "0.2.1"
20147+
resolved "https://registry.yarnpkg.com/tsec/-/tsec-0.2.1.tgz#017423174b2be54f26da5cb7591dc7035996086b"
20148+
integrity sha512-RP9vhbRbRI9VH4CfOlQvo5W9HdfiPKq0gdiUOWI5oKmLaZKNFN8CsPwBfT5ySmhnKNwmmAS/BtY3WoTfABwwig==
20149+
dependencies:
20150+
glob "^7.1.1"
20151+
minimatch "^3.0.3"
20152+
2014520153
tslib@1.11.1, tslib@^1.8.1, tslib@^1.9.0:
2014620154
version "1.11.1"
2014720155
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"

0 commit comments

Comments
 (0)