eslint-define-config
Advanced tools
Comparing version 1.0.0-alpha.4 to 1.0.0
# Next | ||
[diff](https://github.com/Shinigami92/eslint-define-config/compare/1.0.0-alpha.4...main) | ||
[diff](https://github.com/Shinigami92/eslint-define-config/compare/1.0.0...main) | ||
# 1.0.0 | ||
[diff](https://github.com/Shinigami92/eslint-define-config/compare/1.0.0-alpha.4...1.0.0) | ||
## Initial release | ||
Not every eslint core rule is currently typed, but any _unknown_ rule will just fall back to a basic typed rule. | ||
If you miss a rule or some other type definitions, feel free to create an issue or PR. | ||
# 1.0.0-alpha.4 | ||
@@ -6,0 +16,0 @@ |
{ | ||
"name": "eslint-define-config", | ||
"version": "1.0.0-alpha.4", | ||
"version": "1.0.0", | ||
"description": "Provide a defineConfig function for .eslintrc.js files", | ||
@@ -14,6 +14,10 @@ "main": "src/index.js", | ||
"keywords": [ | ||
"config", | ||
"configuration", | ||
"define-config", | ||
"eslint-config", | ||
"eslint", | ||
"define-config", | ||
"config", | ||
"typed" | ||
"eslintconfig", | ||
"typed", | ||
"typescript" | ||
], | ||
@@ -41,3 +45,3 @@ "author": { | ||
"eslint-config-prettier": "~8.1.0", | ||
"eslint-define-config": "~1.0.0-alpha.3", | ||
"eslint-define-config": "~1.0.0-alpha.4", | ||
"eslint-plugin-inclusive-language": "~2.1.1", | ||
@@ -44,0 +48,0 @@ "eslint-plugin-jsdoc": "~32.3.0", |
@@ -47,2 +47,13 @@ <p> | ||
# Why? | ||
Improve your eslint configuration experience with: | ||
- auto-suggestions | ||
- type checking | ||
- documentation | ||
- deprecation warnings | ||
![image](https://user-images.githubusercontent.com/7195563/112484789-8a416480-8d7a-11eb-9337-d8b5bc16de17.png) | ||
# Credits | ||
@@ -49,0 +60,0 @@ |
import type { LiteralUnion } from '../utility-types'; | ||
import type { EslintExtensions } from './eslint'; | ||
import type { EslintPluginImportExtensions } from './eslint-plugin-import'; | ||
import type { EslintPluginJsdocExtensions } from './eslint-plugin-jsdoc'; | ||
import type { EslintPluginPrettierExtensions } from './eslint-plugin-prettier'; | ||
import type { TypescriptEslintExtensions } from './typescript-eslint'; | ||
@@ -7,3 +11,9 @@ /** | ||
*/ | ||
export type KnownExtensions = LiteralUnion<EslintExtensions>; | ||
export type KnownExtensions = LiteralUnion< | ||
| EslintExtensions | ||
| TypescriptEslintExtensions | ||
| EslintPluginPrettierExtensions | ||
| EslintPluginImportExtensions | ||
| EslintPluginJsdocExtensions | ||
>; | ||
@@ -10,0 +20,0 @@ /** |
import type { Environments } from './env'; | ||
import type { Extends } from './extends'; | ||
import type { Overrides } from './overrides'; | ||
import type { ParserOptions } from './parser-options'; | ||
import type { Parser, ParserOptions } from './parser-options'; | ||
import type { Plugin } from './plugin'; | ||
import type { Rules } from './rules'; | ||
@@ -42,3 +43,3 @@ import type { Settings } from './settings'; | ||
*/ | ||
parser?: string; | ||
parser?: Parser; | ||
/** | ||
@@ -56,3 +57,3 @@ * Parser Options. | ||
*/ | ||
plugins?: string[]; | ||
plugins?: Plugin[]; | ||
/** | ||
@@ -59,0 +60,0 @@ * Rules. |
@@ -0,10 +1,143 @@ | ||
import { LiteralUnion } from './utility-types'; | ||
/** | ||
* Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming. | ||
* | ||
* @default 5 | ||
*/ | ||
export interface ParserOptions { | ||
ecmaVersion?: 2020; | ||
parser?: string; | ||
project?: any; | ||
sourceType?: 'module' | '...'; | ||
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021; | ||
/** | ||
* Set to "script" (default) or "module" if your code is in ECMAScript modules. | ||
*/ | ||
export type SourceType = 'script' | 'module'; | ||
/** Lib. */ | ||
export type Lib = LiteralUnion< | ||
| 'es5' | ||
| 'es6' | ||
| 'es2015' | ||
| 'es7' | ||
| 'es2016' | ||
| 'es2017' | ||
| 'es2018' | ||
| 'es2019' | ||
| 'es2020' | ||
| 'esnext' | ||
| 'dom' | ||
| 'dom.iterable' | ||
| 'webworker' | ||
| 'webworker.importscripts' | ||
| 'webworker.iterable' | ||
| 'scripthost' | ||
| 'es2015.core' | ||
| 'es2015.collection' | ||
| 'es2015.generator' | ||
| 'es2015.iterable' | ||
| 'es2015.promise' | ||
| 'es2015.proxy' | ||
| 'es2015.reflect' | ||
| 'es2015.symbol' | ||
| 'es2015.symbol.wellknown' | ||
| 'es2016.array.include' | ||
| 'es2017.object' | ||
| 'es2017.sharedmemory' | ||
| 'es2017.string' | ||
| 'es2017.intl' | ||
| 'es2017.typedarrays' | ||
| 'es2018.asyncgenerator' | ||
| 'es2018.asynciterable' | ||
| 'es2018.intl' | ||
| 'es2018.promise' | ||
| 'es2018.regexp' | ||
| 'es2019.array' | ||
| 'es2019.object' | ||
| 'es2019.string' | ||
| 'es2019.symbol' | ||
| 'es2020.bigint' | ||
| 'es2020.promise' | ||
| 'es2020.sharedmemory' | ||
| 'es2020.string' | ||
| 'es2020.symbol.wellknown' | ||
| 'es2020.intl' | ||
| 'esnext.array' | ||
| 'esnext.symbol' | ||
| 'esnext.asynciterable' | ||
| 'esnext.intl' | ||
| 'esnext.bigint' | ||
| 'esnext.string' | ||
| 'esnext.promise' | ||
| 'esnext.weakref' | ||
| 'es2016.full' | ||
| 'es2017.full' | ||
| 'es2018.full' | ||
| 'es2019.full' | ||
| 'es2020.full' | ||
| 'esnext.full' | ||
| 'lib' | ||
>; | ||
/** DebugLevel. */ | ||
export type DebugLevel = boolean | Array<'eslint' | 'typescript' | 'typescript-eslint'>; | ||
/** Parser. */ | ||
export type Parser = LiteralUnion<'@typescript-eslint/parser'>; | ||
/** | ||
* Parser options. | ||
* | ||
* @see [Specifying Parser Options](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options) | ||
*/ | ||
export interface ParserOptions extends Partial<Record<string, unknown>> { | ||
/** | ||
* Set to 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 to specify the version of ECMAScript syntax you want to use. You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), or 2021 (same as 12) to use the year-based naming. | ||
* | ||
* @default 5 | ||
*/ | ||
ecmaVersion?: EcmaVersion; | ||
/** | ||
* Set to "script" (default) or "module" if your code is in ECMAScript modules. | ||
*/ | ||
sourceType?: SourceType; | ||
/** | ||
* An object indicating which additional language features you'd like to use. | ||
*/ | ||
ecmaFeatures?: { | ||
/** | ||
* Allow `return` statements in the global scope. | ||
*/ | ||
globalReturn?: boolean; | ||
/** | ||
* Enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is 5 or greater). | ||
*/ | ||
impliedStrict?: boolean; | ||
/** | ||
* Enable [JSX](https://facebook.github.io/jsx/). | ||
*/ | ||
jsx?: boolean; | ||
}; | ||
jsxPragma?: string; | ||
jsxFragmentName?: string | null; | ||
lib?: Lib[]; | ||
comment?: boolean; | ||
debugLevel?: DebugLevel; | ||
errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; | ||
errorOnUnknownASTType?: boolean; | ||
extraFileExtensions?: string[]; | ||
filePath?: string; | ||
loc?: boolean; | ||
/** | ||
* Parser. | ||
* | ||
* @see [Working with Custom Parsers](https://eslint.org/docs/developer-guide/working-with-custom-parsers) | ||
* @see [Specifying Parser](https://eslint.org/docs/user-guide/configuring/plugins#specifying-parser) | ||
*/ | ||
parser?: Parser; | ||
project?: string | string[]; | ||
projectFolderIgnoreList?: Array<string | RegExp>; | ||
range?: boolean; | ||
tokens?: boolean; | ||
tsconfigRootDir?: string; | ||
useJSXTextNode?: boolean; | ||
warnOnUnsupportedTypeScriptVersion?: boolean; | ||
} |
@@ -0,1 +1,3 @@ | ||
import type { CommaDangleRule } from './comma-dangle'; | ||
import type { CurlyRule } from './curly'; | ||
import type { NoDebuggerRule } from './no-debugger'; | ||
@@ -8,2 +10,2 @@ import type { QuotesRule } from './quotes'; | ||
*/ | ||
export type EslintRules = NoDebuggerRule & QuotesRule & SemiRule; | ||
export type EslintRules = CommaDangleRule & CurlyRule & NoDebuggerRule & QuotesRule & SemiRule; |
import type { RuleSeverity } from './rule-severity'; | ||
/** | ||
* | ||
* Rule configuration. | ||
*/ | ||
export type RuleConfig<Options extends unknown[] = unknown[]> = RuleSeverity | [RuleSeverity, ...Options]; |
/** | ||
* | ||
* Rule severity. | ||
*/ | ||
export type RuleSeverity = 'off' | 'warn' | 'error'; | ||
export type RuleSeverity = 'off' | 'warn' | 'error' | 0 | 1 | 2; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
26367
29
694
1
63
0