Skip to content

Commit

Permalink
feat: disable lines-around-comment for type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
prescience-data committed Sep 23, 2022
1 parent c07e406 commit 8fef1c4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
8 changes: 8 additions & 0 deletions stack/eslint-config/.eslintrc.js
Expand Up @@ -5,5 +5,13 @@ module.exports = {
"@rushstack/eslint-config/mixins/friendly-locals",
"@rushstack/eslint-config/profile/web-app",
"./profile/node.js"
],
overrides: [
{
files: ["profile/*.js"],
rules: {
"lines-around-comment": "off"
}
}
]
}
1 change: 1 addition & 0 deletions stack/eslint-config/overrides/index.js
Expand Up @@ -3,5 +3,6 @@ module.exports = {
barrels: require("./barrels"),
javascript: require("./javascript"),
markdown: require("./markdown"),
typeDefinitions: require("./type-definitions"),
typescript: require("./typescript")
}
6 changes: 6 additions & 0 deletions stack/eslint-config/overrides/type-definitions.js
@@ -0,0 +1,6 @@
module.exports = {
files: ["**/types/*.ts", "**/types.ts"],
rules: {
"lines-around-comment": "off"
}
}
28 changes: 20 additions & 8 deletions stack/eslint-config/profile/node.js
Expand Up @@ -14,28 +14,33 @@ const {
barrels,
javascript,
markdown,
typeDefinitions,
typescript
} = require("../overrides")

const { when } = require("../utils")

/**
* Node Eslint Config
* NodeJS ESLint profile.
*
* @remarks
* This profile is intended for use within NodeJS applications.
* Rules may not be appropriate for browser applications.
*
* @public
*/
module.exports = {
// Environment linter should expect.
/* Environment linter should expect. */
env: {
node: true
},
// List of patterns to ignore.
/* List of patterns to ignore. */
ignorePatterns,
// Default parser options for TypeScript.
/* Default parser options for TypeScript. */
parserOptions,
// Third-party plugins to load.
/* Third-party plugins to load. */
plugins,
// Main rules definitions across all included files.
/* Main rule definitions used across all matched files. */
rules: {
"@rushstack/no-new-null": "off",
"@typescript-eslint/member-ordering": "error",
Expand All @@ -58,6 +63,13 @@ module.exports = {
"simple-import-sort/imports": ["error", simpleImportSort],
"tsdoc/syntax": "error"
},
// Pattern specific overrides.
overrides: [anyInTypes, barrels, javascript, markdown, typescript]
/* Pattern specific overrides. */
overrides: [
anyInTypes,
barrels,
javascript,
markdown,
typeDefinitions,
typescript
]
}
2 changes: 1 addition & 1 deletion stack/eslint-config/rules/lines-around-comment.js
@@ -1,7 +1,7 @@
module.exports = {
beforeBlockComment: true,
afterBlockComment: false,
beforeLineComment: false,
beforeLineComment: true,
afterLineComment: false,
allowBlockStart: true,
allowClassStart: true,
Expand Down

0 comments on commit 8fef1c4

Please sign in to comment.