-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: import and add commit scopes from vscode settings to commitlin…
…t config
- Loading branch information
Showing
3 changed files
with
116 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
interface Settings { | ||
'[json]': {'files.insertFinalNewline': true}, | ||
'[jsonc]': {'files.insertFinalNewline': true}, | ||
'auto-close-tag.disableOnLanguage': ['javascript', 'javascriptreact', 'typescript', 'typescriptreact'], | ||
'conventionalCommits.scopes': ['dotnet', 'dotnet/SignAfterPack', 'node', 'vscode', 'deps', 'deps-dev'], | ||
'cSpell.words': [ | ||
'arktype', | ||
'conventionalcommits', | ||
'GHNRI', | ||
'GHPR', | ||
'GLNRI', | ||
'globbed', | ||
'GLPR', | ||
'halospv3', | ||
'nameof', | ||
'packemon', | ||
'polyrepo', | ||
'tseslint', | ||
'tsout' | ||
], | ||
'editor.quickSuggestions': {strings: 'on'}, | ||
'files.readonlyInclude': {'_tsout/**': true, 'node_modules/**': true, 'cjs/**': true, 'mjs/**': true}, | ||
'nodejs-testing.include': ['./', './tests/', './tests/dotnet/', './tests/package.test.ts'], | ||
'nodejs-testing.extensions': [{extensions: ['mts', 'cts', 'ts'], parameters: ['--import', 'tsx']}], | ||
'nodeTdd.glob': '{src,test}/**/*.{js,ts,jsx,tsx,mts}', | ||
'prettier.configPath': 'prettier.config.js', | ||
'typescript.implementationsCodeLens.enabled': true, | ||
'typescript.tsdk': 'node_modules\\typescript\\lib', | ||
'yaml.format.singleQuote': true, | ||
'eslint.probe': [ | ||
'javascript', | ||
'javascriptreact', | ||
'typescript', | ||
'typescriptreact', | ||
'html', | ||
'vue', | ||
'markdown', | ||
'json', | ||
'jsonc', | ||
'json5' | ||
], | ||
'eslint.useFlatConfig': true, | ||
'eslint.useESLintClass': true, | ||
'eslint.validate': [ | ||
'javascript', | ||
'javascriptreact', | ||
'json', | ||
'jsonc', | ||
'json5', | ||
'typescript', | ||
'typescriptreact' | ||
], | ||
'typescript.tsserver.experimental.enableProjectDiagnostics': true, | ||
'typescript.tsserver.web.projectWideIntellisense.enabled': true, | ||
'git.allowNoVerifyCommit': true, | ||
'nodeTdd.showCoverage': true, | ||
'markiscodecoverage.enableDecorations': true, | ||
'nodeTdd.buildOnActivation': true, | ||
'nodeTdd.buildOnCreate': true, | ||
'nodeTdd.buildOnDelete': true, | ||
'nodeTdd.reporter': 'tap', | ||
'sarif-viewer.connectToGithubCodeScanning': 'off', | ||
'gitCommitMessageEditor.intelliSense.completion.scopes': [ | ||
{ | ||
scope: 'dotnet', | ||
description: 'Affects files "./dotnet" or "./src/dotnet" or affects our generic GitHub reusable workflows provided for assisting dotnet CI.' | ||
}, | ||
{ | ||
scope: 'dotnet/ExecNupkgDeterministicator', | ||
description: 'Affects the ExecNupkgDeterministicator target.' | ||
}, | ||
{ | ||
scope: 'dotnet/SignAfterPack', | ||
description: 'Affects the SignAfterPack target.' | ||
}, | ||
{ | ||
scope: 'dotnet/samples/HCE.Shared.DeterministicNupkg', | ||
description: 'Affects the HCE.Shared.DeterministicNupkg sample project.' | ||
}, | ||
{ | ||
scope: 'dotnet/samples/HCE.Shared.SignAfterPack', | ||
description: 'Affects the SignAfterPack sample project.' | ||
}, | ||
{scope: 'vscode', description: 'Affects files in "./.vscode".'}, | ||
{scope: 'deps', description: 'Affects dependencies required at runtime.'}, | ||
{ | ||
scope: 'deps-dev', | ||
description: 'Affects dependencies required in the dev environment or during build time.' | ||
} | ||
] | ||
} | ||
|
||
declare const Settings: Settings; | ||
|
||
export = Settings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
import commitlintConfig from '@halospv3/hce.shared-config/commitlintConfig'; | ||
import commitlintConfig from '@halospv3/hce.shared-config/commitlintConfig' | ||
import { RuleConfigSeverity } from '@commitlint/types' | ||
import vscodeSettingsJson from './.vscode/settings.json' assert { type: 'json' } | ||
/** @typedef {import('./.vscode/settings.json.d.ts')} VscodeSettings */ | ||
/** @typedef {import('@commitlint/types').RuleConfigCondition} RuleConfigCondition */ | ||
// Remember to update the d.ts! This should be part of TypeScript, but is blocked by https://github.com/microsoft/TypeScript/issues/32063 | ||
const gitCommitMessageEditorScopes = Object.freeze( | ||
/** @type {VscodeSettings['gitCommitMessageEditor.intelliSense.completion.scopes']} */ | ||
(vscodeSettingsJson['gitCommitMessageEditor.intelliSense.completion.scopes']), | ||
) | ||
|
||
/** @type {import('@commitlint/types').UserConfig} */ | ||
export default { | ||
...commitlintConfig | ||
}; | ||
...commitlintConfig, | ||
rules: { | ||
'scope-enum': Object.freeze([ | ||
RuleConfigSeverity.Error, | ||
/** @type {RuleConfigCondition} */ | ||
('always'), | ||
gitCommitMessageEditorScopes.map(entry => entry.scope), | ||
]), | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
"outDir": "_tsout" | ||
}, | ||
"include": [ | ||
"./.vscode/settings.json", | ||
"./*.cjs", | ||
"./*.js", | ||
"./*.mjs", | ||
|