Skip to content

Commit 5e0240f

Browse files
authored
Merge pull request #330 from salesforcecli/phale/strict-null-checks
fix: add strict null checks
2 parents d730f40 + 1c746cd commit 5e0240f

22 files changed

+1136
-1376
lines changed

.eslintrc.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@
77
module.exports = {
88
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license'],
99
rules: {
10-
'@typescript-eslint/restrict-template-expressions': 'off',
11-
'@typescript-eslint/explicit-function-return-type': 'off',
12-
'@typescript-eslint/no-unsafe-assignment': 'off',
13-
'@typescript-eslint/no-unsafe-member-access': 'off',
14-
'@typescript-eslint/no-unsafe-call': 'off',
15-
'@typescript-eslint/no-unsafe-return': 'off',
16-
'@typescript-eslint/member-ordering': 'off',
1710
'no-underscore-dangle': 'off',
18-
'@typescript-eslint/explicit-module-boundary-types': 'off',
19-
'no-empty': 'off',
20-
'@typescript-eslint/no-explicit-any': 'off',
11+
'jsdoc/newline-after-description': 'off',
2112
},
2213
};

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ package-lock.json
1010
npm-error.log
1111
yarn-error.log
1212
lerna-debug.log
13-
*.tsbuildinfo
1413

1514
# compile source
1615
lib
@@ -26,6 +25,9 @@ coverage
2625
docs
2726

2827
# -- CLEAN ALL
28+
*.tsbuildinfo
29+
.eslintcache
30+
.wireit
2931
node_modules
3032

3133
# --

.sfdevrc.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,24 @@
22
"test": {
33
"testsPath": "test/**/*.test.ts"
44
},
5-
"exclude-scripts": ["pretest"]
5+
"exclude-scripts": ["pretest"],
6+
"wireit": {
7+
"test": {
8+
"dependencies": ["test:only", "lint"]
9+
},
10+
"test:only": {
11+
"command": "nyc mocha \"test/**/*.test.ts\"",
12+
"env": {
13+
"FORCE_COLOR": "2"
14+
},
15+
"dependencies": ["test:compile", "test:command-reference"],
16+
"files": ["test/**/*.ts", "src/**/*.ts", "**/tsconfig.json", ".mocha*", "!*.nut.ts", ".nycrc", "tmp/test/**"],
17+
"output": []
18+
},
19+
"test:command-reference": {
20+
"command": "\"./bin/dev\" commandreference:generate --plugins auth --outputdir ./tmp/test",
21+
"files": ["src/**/*.ts", "messages/**", "package.json"],
22+
"output": ["tmp/test/**"]
23+
}
24+
}
625
}

package.json

Lines changed: 138 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,48 @@
55
"author": "Salesforce",
66
"bugs": "https://github.com/salesforcecli/plugin-command-reference/issues",
77
"dependencies": {
8-
"@oclif/core": "^2.0.7",
9-
"@salesforce/core": "^3.32.12",
10-
"@salesforce/kit": "^1.8.2",
11-
"@salesforce/sf-plugins-core": "^2.0.1",
8+
"@oclif/core": "^2.8.2",
9+
"@salesforce/core": "^3.34.7",
10+
"@salesforce/kit": "^1.9.2",
11+
"@salesforce/sf-plugins-core": "^2.2.9",
1212
"@salesforce/ts-types": "^1.7.1",
1313
"chalk": "^3.0.0",
14-
"fs-extra": "^10.0.1",
1514
"handlebars": "^4.7.7",
1615
"lodash.uniqby": "^4.7.0",
1716
"mkdirp": "^1.0.4",
1817
"tslib": "^2"
1918
},
2019
"devDependencies": {
21-
"@oclif/plugin-help": "^5.1.1",
20+
"@oclif/plugin-help": "^5.2.9",
2221
"@salesforce/dev-config": "^3.1.0",
23-
"@salesforce/dev-scripts": "^2.0.4",
24-
"@salesforce/plugin-login": "^1.1.15",
22+
"@salesforce/dev-scripts": "^4.3.0",
23+
"@salesforce/plugin-auth": "^2.7.12",
2524
"@salesforce/prettier-config": "^0.0.2",
25+
"@types/debug": "^4.1.7",
2626
"@types/fs-extra": "^9.0.13",
2727
"@types/lodash.uniqby": "^4.7.6",
28-
"@typescript-eslint/eslint-plugin": "^4.2.0",
29-
"@typescript-eslint/parser": "^4.2.0",
28+
"@typescript-eslint/eslint-plugin": "^5.59.0",
29+
"@typescript-eslint/parser": "^5.59.0",
3030
"chai": "^4.2.0",
31-
"eslint": "^7.27.0",
32-
"eslint-config-prettier": "^6.11.0",
33-
"eslint-config-salesforce": "^0.1.6",
34-
"eslint-config-salesforce-license": "^0.1.6",
35-
"eslint-config-salesforce-typescript": "^0.2.8",
31+
"eslint": "^8.38.0",
32+
"eslint-config-prettier": "^8.8.0",
33+
"eslint-config-salesforce": "^1.2.0",
34+
"eslint-config-salesforce-license": "^0.2.0",
35+
"eslint-config-salesforce-typescript": "^1.1.1",
3636
"eslint-plugin-header": "^3.0.0",
37-
"eslint-plugin-import": "2.24.2",
38-
"eslint-plugin-jsdoc": "^35.1.2",
39-
"eslint-plugin-prettier": "^3.1.3",
37+
"eslint-plugin-import": "^2.27.5",
38+
"eslint-plugin-jsdoc": "^43.0.7",
4039
"husky": "^7.0.4",
41-
"mocha": "^9.1.3",
40+
"mocha": "^10.2.0",
4241
"nyc": "^15.1.0",
43-
"oclif": "^3.6.1",
44-
"prettier": "^2.0.5",
42+
"oclif": "^3.8.1",
43+
"prettier": "^2.8.7",
4544
"pretty-quick": "^3.1.0",
4645
"shx": "^0.3.3",
4746
"sinon": "10.0.0",
4847
"ts-node": "^10.0.0",
49-
"typescript": "^4.1.3"
48+
"typescript": "^4.9.5",
49+
"wireit": "^0.9.5"
5050
},
5151
"engines": {
5252
"node": ">=14.0.0"
@@ -78,30 +78,134 @@
7878
},
7979
"devPlugins": [
8080
"@oclif/plugin-help",
81-
"@salesforce/plugin-login"
81+
"@salesforce/plugin-auth"
8282
]
8383
},
8484
"repository": "salesforcecli/plugin-command-reference",
8585
"scripts": {
86-
"build": "sf-build",
86+
"build": "wireit",
8787
"clean": "sf-clean",
8888
"clean-all": "sf-clean all",
89-
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
90-
"command-reference": "./bin/dev commandreference:generate --plugins login --outputdir test/tmp",
91-
"compile": "sf-compile",
89+
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -rf test/tmp && shx rm -f oclif.manifest.json",
90+
"compile": "wireit",
9291
"docs": "sf-docs",
93-
"format": "sf-format",
94-
"lint": "sf-lint",
92+
"format": "wireit",
93+
"lint": "wireit",
9594
"postpack": "shx rm -f oclif.manifest.json",
96-
"posttest": "yarn lint",
9795
"prepack": "sf-prepack",
9896
"prepare": "sf-install",
99-
"pretest": "sf-compile-test && yarn command-reference",
100-
"test": "sf-test",
97+
"test": "wireit",
98+
"test:only": "wireit",
10199
"version": "oclif readme"
102100
},
103101
"publishConfig": {
104102
"access": "public"
105103
},
106-
"main": "lib/index.js"
107-
}
104+
"main": "lib/index.js",
105+
"wireit": {
106+
"build": {
107+
"dependencies": [
108+
"compile",
109+
"lint"
110+
]
111+
},
112+
"compile": {
113+
"command": "tsc -p . --pretty --incremental",
114+
"files": [
115+
"src/**/*.ts",
116+
"**/tsconfig.json",
117+
"messages/**"
118+
],
119+
"output": [
120+
"lib/**",
121+
"*.tsbuildinfo"
122+
],
123+
"clean": "if-file-deleted"
124+
},
125+
"format": {
126+
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
127+
"files": [
128+
"src/**/*.ts",
129+
"test/**/*.ts",
130+
"schemas/**/*.json",
131+
"command-snapshot.json",
132+
".prettier*"
133+
],
134+
"output": []
135+
},
136+
"lint": {
137+
"command": "eslint src test --color --cache --cache-location .eslintcache",
138+
"files": [
139+
"src/**/*.ts",
140+
"test/**/*.ts",
141+
"messages/**",
142+
"**/.eslint*",
143+
"**/tsconfig.json"
144+
],
145+
"output": []
146+
},
147+
"test:compile": {
148+
"command": "tsc -p \"./test\" --pretty",
149+
"files": [
150+
"test/**/*.ts",
151+
"**/tsconfig.json"
152+
],
153+
"output": []
154+
},
155+
"test": {
156+
"dependencies": [
157+
"test:only",
158+
"lint"
159+
]
160+
},
161+
"test:only": {
162+
"command": "nyc mocha \"test/**/*.test.ts\"",
163+
"env": {
164+
"FORCE_COLOR": "2"
165+
},
166+
"dependencies": [
167+
"test:compile",
168+
"test:command-reference"
169+
],
170+
"files": [
171+
"test/**/*.ts",
172+
"src/**/*.ts",
173+
"**/tsconfig.json",
174+
".mocha*",
175+
"!*.nut.ts",
176+
".nycrc",
177+
"tmp/test/**"
178+
],
179+
"output": []
180+
},
181+
"test:command-reference": {
182+
"command": "\"./bin/dev\" commandreference:generate --plugins auth --outputdir ./tmp/test",
183+
"files": [
184+
"src/**/*.ts",
185+
"messages/**",
186+
"package.json"
187+
],
188+
"output": [
189+
"tmp/test/**"
190+
]
191+
},
192+
"test:deprecation-policy": {
193+
"command": "\"./bin/dev\" snapshot:compare",
194+
"files": [
195+
"src/**/*.ts"
196+
],
197+
"output": [],
198+
"dependencies": [
199+
"compile"
200+
]
201+
},
202+
"test:json-schema": {
203+
"command": "\"./bin/dev\" schema:compare",
204+
"files": [
205+
"src/**/*.ts",
206+
"schemas"
207+
],
208+
"output": []
209+
}
210+
}
211+
}

0 commit comments

Comments
 (0)