This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move config to config.ts and add types for config
- Loading branch information
Showing
5 changed files
with
77 additions
and
57 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,68 @@ | ||
export const config = { | ||
"enableSemanticRules": { | ||
"type": "boolean", | ||
"title": "Enable semantic rules", | ||
"description": "Allow passing a TypeScript program object to the linter. May negatively affect performance. See this page for details: https://palantir.github.io/tslint/usage/type-checking/", | ||
"default": false, | ||
"order": 1 | ||
}, | ||
"rulesDirectory": { | ||
"type": "string", | ||
"title": "Custom rules directory (absolute path)", | ||
"default": "", | ||
"order": 2 | ||
}, | ||
"fixOnSave": { | ||
"title": "Fix errors on save", | ||
"description": "Have tslint attempt to fix some errors automatically when saving the file.", | ||
"type": "boolean", | ||
"default": false, | ||
"order": 3 | ||
}, | ||
"ignoreTypings": { | ||
"type": "boolean", | ||
"title": "Ignore typings files (.d.ts)", | ||
"default": false, | ||
"order": 4 | ||
}, | ||
"useLocalTslint": { | ||
"type": "boolean", | ||
"title": "Try to use the project's local tslint package, if it exists", | ||
"default": true, | ||
"order": 5 | ||
}, | ||
"useGlobalTslint": { | ||
"type": "boolean", | ||
"title": "Use the global tslint install", | ||
"description": "If enabled, the global tslint installation will be used as a fallback, instead of the version packaged with linter-tslint.", | ||
"default": false, | ||
"order": 6 | ||
}, | ||
"globalNodePath": { | ||
"type": "string", | ||
"title": "Global node installation path", | ||
"description": "The location of your global npm install. (Will default to `npm get prefix`.)", | ||
"default": "", | ||
"order": 7 | ||
} | ||
} | ||
|
||
export interface ConfigSchema { | ||
enableSemanticRules: boolean, | ||
rulesDirectory: string | null, | ||
fixOnSave: boolean, | ||
ignoreTypings: boolean, | ||
useLocalTslint: boolean, | ||
useGlobalTslint: boolean, | ||
globalNodePath: string | null, | ||
} | ||
|
||
export const defaultConfig = { | ||
enableSemanticRules: false, | ||
rulesDirectory: "", | ||
fixOnSave: false, | ||
ignoreTypings: false, | ||
useLocalTslint: true, | ||
useGlobalTslint: false, | ||
globalNodePath: "", | ||
} |
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
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
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
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