Skip to content

Commit

Permalink
Merge pull request #379 from iclanton/general-updates
Browse files Browse the repository at this point in the history
Enable some stricter compiler and linting options, and general repo cleanup.
  • Loading branch information
iclanton authored May 28, 2024
2 parents ae41fe7 + e496c92 commit f3690de
Show file tree
Hide file tree
Showing 148 changed files with 3,865 additions and 2,682 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

# Don't allow people to merge changes to these generated files, because the result
# may be invalid. You need to run "rush update" again.
pnpm-lock.yaml merge=binary
pnpm-lock.yaml merge=text
shrinkwrap.yaml merge=binary
npm-shrinkwrap.json merge=binary
yarn.lock merge=binary
Expand Down
18 changes: 12 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ bower_components
build/Release

# Dependency directories
node_modules/
jspm_packages/
node_modules
jspm_packages

# Optional npm cache directory
.npm
Expand All @@ -58,11 +58,21 @@ jspm_packages/
# OS X temporary files
.DS_Store

# IntelliJ IDEA project files; if you want to commit IntelliJ settings, this recipe may be helpful:
# https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
.idea/
*.iml

# Rush temporary files
common/deploy/
common/temp/
common/autoinstallers/*/.npmrc
**/.rush/temp/
*.lock

# Heft temporary files
.cache
.heft

# Common toolchain intermediate files
temp
Expand All @@ -77,7 +87,3 @@ dist

# Visual Studio Code
.vscode

# Heft
*/.heft/build-cache/**
*/.heft/temp/**
39 changes: 36 additions & 3 deletions api-demo/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch/modern-module-resolution');
require('@rushstack/heft-node-rig/profiles/default/includes/eslint/patch/modern-module-resolution');
// This is a workaround for https://github.com/microsoft/rushstack/issues/3021
require('@rushstack/heft-node-rig/profiles/default/includes/eslint/patch/custom-config-package-names');

module.exports = {
extends: ['@rushstack/eslint-config/profile/node', '@rushstack/eslint-config/mixins/friendly-locals'],
parserOptions: { tsconfigRootDir: __dirname }
extends: [
'@rushstack/heft-node-rig/profiles/default/includes/eslint/profile/node',
'@rushstack/heft-node-rig/profiles/default/includes/eslint/mixins/friendly-locals'
],
parserOptions: { tsconfigRootDir: __dirname },

plugins: ['eslint-plugin-header'],
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
// Rationale: Including the `type` annotation in the import statement for imports
// only used as types prevents the import from being emitted in the compiled output.
'@typescript-eslint/consistent-type-imports': [
'warn',
{ prefer: 'type-imports', disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' }
],

// Rationale: If all imports in an import statement are only used as types,
// then the import statement should be omitted in the compiled JS output.
'@typescript-eslint/no-import-type-side-effects': 'warn',

'header/header': [
'warn',
'line',
[
' Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.',
' See LICENSE in the project root for license information.'
]
]
}
}
]
};
3 changes: 0 additions & 3 deletions api-demo/.npmrc

This file was deleted.

14 changes: 8 additions & 6 deletions api-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
"dependencies": {
"@microsoft/tsdoc": "workspace:*",
"colors": "~1.4.0",
"typescript": "~5.0.4"
"typescript": "~5.4.2"
},
"devDependencies": {
"@rushstack/eslint-config": "~3.3.1",
"@rushstack/heft-node-rig": "2.2.5",
"@rushstack/heft": "^0.53.1",
"@rushstack/heft-node-rig": "~2.6.11",
"@rushstack/heft": "^0.66.13",
"@types/heft-jest": "1.0.3",
"@types/node": "14.18.36",
"eslint": "~8.42.0"
"eslint": "~8.57.0",
"eslint-plugin-header": "~3.1.1"
},
"scripts": {
"build": "heft test --clean",
"simple": "node ./lib/start.js simple",
"advanced": "node ./lib/start.js advanced"
"advanced": "node ./lib/start.js advanced",
"_phase:build": "heft run --only build -- --clean",
"_phase:test": "heft run --only test -- --clean"
}
}
5 changes: 4 additions & 1 deletion api-demo/src/Formatter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { DocNode, DocExcerpt } from '@microsoft/tsdoc';
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import { type DocNode, DocExcerpt } from '@microsoft/tsdoc';

/**
* This is a simplistic solution until we implement proper DocNode rendering APIs.
Expand Down
3 changes: 3 additions & 0 deletions api-demo/src/advancedDemo.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import colors from 'colors';
import * as os from 'os';
import * as path from 'path';
Expand Down
5 changes: 4 additions & 1 deletion api-demo/src/simpleDemo.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import colors from 'colors';
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
import { TSDocParser, ParserContext, DocComment } from '@microsoft/tsdoc';
import { TSDocParser, type ParserContext, type DocComment } from '@microsoft/tsdoc';
import { Formatter } from './Formatter';

/**
Expand Down
3 changes: 3 additions & 0 deletions api-demo/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import * as colors from 'colors';
import * as os from 'os';
import { simpleDemo } from './simpleDemo';
Expand Down
1 change: 1 addition & 0 deletions api-demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
"compilerOptions": {
"isolatedModules": true,
"types": ["heft-jest", "node"]
}
}
4 changes: 2 additions & 2 deletions common/autoinstallers/rush-prettier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"dependencies": {
"pretty-quick": "2.0.1",
"prettier": "2.0.5"
"pretty-quick": "4.0.0",
"prettier": "3.2.5"
}
}
Loading

0 comments on commit f3690de

Please sign in to comment.