-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional
rxjsConfig()
for @smarttools/eslint-plugin-rxjs
- Loading branch information
1 parent
cede1d0
commit 1fbd2bc
Showing
5 changed files
with
49 additions
and
5 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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
const perfectiveEslintConfig = require('./dist'); | ||
const { cypressConfig } = require('./dist/cypress'); | ||
const { rxjsConfig } = require('./dist/rxjs'); | ||
|
||
module.exports = perfectiveEslintConfig.default; | ||
module.exports = [ | ||
...perfectiveEslintConfig.default, | ||
cypressConfig(), | ||
rxjsConfig(), | ||
]; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// eslint-disable-next-line import/no-extraneous-dependencies -- ESLint parser used only during development | ||
import * as tsEslint from 'typescript-eslint'; | ||
|
||
import { rxjsConfig as rxjsPluginConfig } from './rules/rxjs'; | ||
|
||
/** | ||
* Configuration for @smarttools/eslint-plugin-rxjs. | ||
* | ||
* @param files - A list of globs with the files to lint. | ||
*/ | ||
export function rxjsConfig(files: string[] = ['**/*.ts?(x)']): Record<string, unknown> { | ||
return { | ||
files, | ||
languageOptions: { | ||
parser: tsEslint.parser, | ||
parserOptions: { | ||
// Parser options have to be duplicated when the parser is overridden | ||
ecmaVersion: 6, | ||
ecmaFeatures: { | ||
globalReturn: false, | ||
impliedStrict: true, | ||
}, | ||
sourceType: 'module', | ||
// TypeScript ESLint Parser | ||
project: './tsconfig.json', | ||
warnOnUnsupportedTypeScriptVersion: true, | ||
}, | ||
}, | ||
plugins: { | ||
...rxjsPluginConfig.plugins, | ||
}, | ||
rules: { | ||
...rxjsPluginConfig.rules, | ||
}, | ||
}; | ||
} |