chore: 🔧 rename package

This commit is contained in:
Guz013
2023-07-21 14:29:48 -03:00
parent ac9bfbd232
commit 5aaaa9ac0e
23 changed files with 53 additions and 11 deletions

View File

@@ -21,5 +21,8 @@
"json",
"jsonc",
"yaml"
],
"cSpell.words": [
"ESLIT"
]
}

View File

@@ -1,4 +1,4 @@
import { defineConfig } from '@eslit/core';
import { defineConfig } from '@eslit/config';
export default defineConfig({
environment: {

View File

@@ -11,7 +11,7 @@
"license": "MIT",
"type": "module",
"dependencies": {
"@eslit/core": "workspace:*"
"@eslit/config": "workspace:*"
},
"devDependencies": {
"@changesets/cli": "^2.26.2",

4
packages/config/index.d.ts vendored Normal file
View File

@@ -0,0 +1,4 @@
import type { EnvOptions } from './src/types';
import type { Linter } from 'eslint';
export async function defineConfig(eslintConfig: Linter.FlatConfig[], environment: EnvOptions): Promise<Linter.FlatConfig[]>;

View File

@@ -1,5 +1,5 @@
{
"name": "@eslit/core",
"name": "@eslit/config",
"version": "0.1.0",
"description": "",
"main": "index.js",

View File

@@ -7,9 +7,9 @@ import * as configs from './configs/index.js';
import { getTsConfigs } from './tsconfigs.js';
/**
* @param {import('./types').Config} userConfig
* @param {import('./types.js').Config} userConfig
* User configuration
* @returns {Promise<import('./types').ESConfig[]>}
* @returns {Promise<import('./types.js').ESConfig[]>}
* The complete list of configs for ESLint
*/
export async function defineConfig(userConfig) {

View File

@@ -3,6 +3,44 @@ import type { Linter } from 'eslint';
export type ESConfig = Readonly<Linter.FlatConfig>;
export interface EnvOptions {
ESLIT_TSCONFIG?: string | string[] | true
ESLIT_ROOT?: string
ESLIT_INDENT?: 'tab' | 'space' | number
ESLIT_ECMASCRIPT?: Linter.ParserOptions['ecmaVersion']
ESLIT_SEMI?: 'never' | 'always'
/**
* Typescript's type-checking is able to infer types from parameters.
* So using an explicit `:` type annotation isn't obligatory.
*
* But, **by default in strict mode**, type annotations are always mandated to make
* the code more readable, explicit and robust to changes.
*
* See {@link https://typescript-eslint.io/rules/no-inferrable-types typescript-eslint documentation }
* for more info.
* ---
* **Option: `never`** (default)
* Types are always explicit in Typescript
*
* @example ```ts
// Typescript
const id: number = 10;
const name: string = 'foo';
```
* ---
* **Option: `always`**
* Types are always inferred in Typescript
*
* @example ```ts
// Typescript
const id = 10;
const name = 'foo';
```
*/
ESLIT_INFER_TYPES?: inferrableTypesOptions
[ENV: string]: unknown
}
export interface Config {
tsconfig?: string | string[] | true
strict?: boolean

View File

@@ -1,3 +0,0 @@
import type { Config, ESConfig } from './src/types';
export async function defineConfig(config: Config): Promise<ESConfig[]>;

6
pnpm-lock.yaml generated
View File

@@ -8,9 +8,9 @@ importers:
.:
dependencies:
'@eslit/core':
'@eslit/config':
specifier: workspace:*
version: link:packages/core
version: link:packages/config
devDependencies:
'@changesets/cli':
specifier: ^2.26.2
@@ -76,7 +76,7 @@ importers:
specifier: ^4.4.2
version: 4.4.2
packages/core:
packages/config:
dependencies:
'@eslint/eslintrc':
specifier: ^2.1.0