Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable some stricter compiler and linting options, and general repo cleanup. #379

Merged
merged 12 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
iclanton marked this conversation as resolved.
Show resolved Hide resolved
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
iclanton marked this conversation as resolved.
Show resolved Hide resolved

# 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
iclanton marked this conversation as resolved.
Show resolved Hide resolved

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

# Heft temporary files
.cache
.heft
iclanton marked this conversation as resolved.
Show resolved Hide resolved

# 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
Loading