Skip to content

Commit f3690de

Browse files
authored
Merge pull request #379 from iclanton/general-updates
Enable some stricter compiler and linting options, and general repo cleanup.
2 parents ae41fe7 + e496c92 commit f3690de

File tree

148 files changed

+3865
-2682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+3865
-2682
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
# Don't allow people to merge changes to these generated files, because the result
6666
# may be invalid. You need to run "rush update" again.
67-
pnpm-lock.yaml merge=binary
67+
pnpm-lock.yaml merge=text
6868
shrinkwrap.yaml merge=binary
6969
npm-shrinkwrap.json merge=binary
7070
yarn.lock merge=binary

.gitignore

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ bower_components
3131
build/Release
3232

3333
# Dependency directories
34-
node_modules/
35-
jspm_packages/
34+
node_modules
35+
jspm_packages
3636

3737
# Optional npm cache directory
3838
.npm
@@ -58,11 +58,21 @@ jspm_packages/
5858
# OS X temporary files
5959
.DS_Store
6060

61+
# IntelliJ IDEA project files; if you want to commit IntelliJ settings, this recipe may be helpful:
62+
# https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
63+
.idea/
64+
*.iml
65+
6166
# Rush temporary files
6267
common/deploy/
6368
common/temp/
6469
common/autoinstallers/*/.npmrc
6570
**/.rush/temp/
71+
*.lock
72+
73+
# Heft temporary files
74+
.cache
75+
.heft
6676

6777
# Common toolchain intermediate files
6878
temp
@@ -77,7 +87,3 @@ dist
7787

7888
# Visual Studio Code
7989
.vscode
80-
81-
# Heft
82-
*/.heft/build-cache/**
83-
*/.heft/temp/**

api-demo/.eslintrc.js

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
11
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2-
require('@rushstack/eslint-config/patch/modern-module-resolution');
2+
require('@rushstack/heft-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
3+
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
4+
require('@rushstack/heft-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');
35

46
module.exports = {
5-
extends: ['@rushstack/eslint-config/profile/node', '@rushstack/eslint-config/mixins/friendly-locals'],
6-
parserOptions: { tsconfigRootDir: __dirname }
7+
extends: [
8+
'@rushstack/heft-node-rig/profiles/default/includes/eslint/profile/node',
9+
'@rushstack/heft-node-rig/profiles/default/includes/eslint/mixins/friendly-locals'
10+
],
11+
parserOptions: { tsconfigRootDir: __dirname },
12+
13+
plugins: ['eslint-plugin-header'],
14+
overrides: [
15+
{
16+
files: ['*.ts', '*.tsx'],
17+
rules: {
18+
// Rationale: Including the `type` annotation in the import statement for imports
19+
// only used as types prevents the import from being emitted in the compiled output.
20+
'@typescript-eslint/consistent-type-imports': [
21+
'warn',
22+
{ prefer: 'type-imports', disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' }
23+
],
24+
25+
// Rationale: If all imports in an import statement are only used as types,
26+
// then the import statement should be omitted in the compiled JS output.
27+
'@typescript-eslint/no-import-type-side-effects': 'warn',
28+
29+
'header/header': [
30+
'warn',
31+
'line',
32+
[
33+
' Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.',
34+
' See LICENSE in the project root for license information.'
35+
]
36+
]
37+
}
38+
}
39+
]
740
};

api-demo/.npmrc

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

api-demo/package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@
77
"dependencies": {
88
"@microsoft/tsdoc": "workspace:*",
99
"colors": "~1.4.0",
10-
"typescript": "~5.0.4"
10+
"typescript": "~5.4.2"
1111
},
1212
"devDependencies": {
13-
"@rushstack/eslint-config": "~3.3.1",
14-
"@rushstack/heft-node-rig": "2.2.5",
15-
"@rushstack/heft": "^0.53.1",
13+
"@rushstack/heft-node-rig": "~2.6.11",
14+
"@rushstack/heft": "^0.66.13",
1615
"@types/heft-jest": "1.0.3",
1716
"@types/node": "14.18.36",
18-
"eslint": "~8.42.0"
17+
"eslint": "~8.57.0",
18+
"eslint-plugin-header": "~3.1.1"
1919
},
2020
"scripts": {
2121
"build": "heft test --clean",
2222
"simple": "node ./lib/start.js simple",
23-
"advanced": "node ./lib/start.js advanced"
23+
"advanced": "node ./lib/start.js advanced",
24+
"_phase:build": "heft run --only build -- --clean",
25+
"_phase:test": "heft run --only test -- --clean"
2426
}
2527
}

api-demo/src/Formatter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { DocNode, DocExcerpt } from '@microsoft/tsdoc';
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
import { type DocNode, DocExcerpt } from '@microsoft/tsdoc';
25

36
/**
47
* This is a simplistic solution until we implement proper DocNode rendering APIs.

api-demo/src/advancedDemo.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
14
import colors from 'colors';
25
import * as os from 'os';
36
import * as path from 'path';

api-demo/src/simpleDemo.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
14
import colors from 'colors';
25
import * as fs from 'fs';
36
import * as path from 'path';
47
import * as os from 'os';
5-
import { TSDocParser, ParserContext, DocComment } from '@microsoft/tsdoc';
8+
import { TSDocParser, type ParserContext, type DocComment } from '@microsoft/tsdoc';
69
import { Formatter } from './Formatter';
710

811
/**

api-demo/src/start.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
14
import * as colors from 'colors';
25
import * as os from 'os';
36
import { simpleDemo } from './simpleDemo';

api-demo/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$schema": "http://json.schemastore.org/tsconfig",
33
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
44
"compilerOptions": {
5+
"isolatedModules": true,
56
"types": ["heft-jest", "node"]
67
}
78
}

0 commit comments

Comments
 (0)