-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cbd753
commit 5d6465c
Showing
2 changed files
with
53 additions
and
21 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,49 @@ | ||
/** | ||
* Sets the core defaults | ||
*/ | ||
export const name = "core/defaults"; | ||
import { rule as checkInternalSlots } from "./core/linter-rules/check-internal-slots"; | ||
import { rule as checkPunctuation } from "./core/linter-rules/check-punctuation"; | ||
import { definitionMap } from "./core/dfn-map"; | ||
import linter from "./core/linter"; | ||
import { rule as localRefsExist } from "./core/linter-rules/local-refs-exist"; | ||
import { rule as noHeadinglessSectionsRule } from "./core/linter-rules/no-headingless-sections"; | ||
import { rule as noHttpPropsRule } from "./core/linter-rules/no-http-props"; | ||
|
||
linter.register( | ||
noHttpPropsRule, | ||
noHeadinglessSectionsRule, | ||
checkPunctuation, | ||
localRefsExist, | ||
checkInternalSlots | ||
); | ||
|
||
const coreDefaults = { | ||
lint: { | ||
"no-headingless-sections": true, | ||
"no-http-props": true, | ||
"check-punctuation": false, | ||
"local-refs-exist": true, | ||
"check-internal-slots": false, | ||
}, | ||
pluralize: true, | ||
highlightVars: true, | ||
license: "CC-BY", | ||
addSectionLinks: true, | ||
}; | ||
|
||
export default coreDefaults; | ||
|
||
export function run(conf) { | ||
// assign the defaults | ||
Object.assign(conf, { | ||
...coreDefaults, | ||
...conf, | ||
}); | ||
Object.assign(conf.lint, { | ||
...coreDefaults.lint, | ||
...conf.lint, | ||
}); | ||
|
||
Object.assign(conf, { definitionMap }); | ||
} |
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