@be-enlighten/eslint-config 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +40 -0
  2. package/index.d.ts +14 -0
  3. package/index.js +44 -0
  4. package/package.json +26 -0
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @be-enlighten/eslint-config
2
+
3
+ Configuração padronizada e unificada de ESLint para todo o ecossistema Enspace / Enlighten.
4
+
5
+ Baseada no `@antfu/eslint-config` com Flat Config (`eslint.config.js`), pré-configura suporte a TypeScript, Vue, Nuxt e regras de consistência da equipe.
6
+
7
+ ## Instalação
8
+
9
+ ```bash
10
+ pnpm add -D @be-enlighten/eslint-config eslint
11
+ ```
12
+
13
+ ## Uso
14
+
15
+ Crie ou atualize o arquivo `eslint.config.js` (ou `eslint.config.mjs`) na raiz do seu projeto:
16
+
17
+ ```javascript
18
+ import { enlighten } from '@be-enlighten/eslint-config'
19
+
20
+ export default enlighten({
21
+ // Opções padrão do antfu:
22
+ vue: true, // ativa suporte a Vue/Nuxt
23
+ typescript: true, // ativa TypeScript (default: true)
24
+ // overrides de regras específicas do repositório:
25
+ rules: {
26
+ 'no-console': 'warn',
27
+ },
28
+ })
29
+ ```
30
+
31
+ ## Script no package.json
32
+
33
+ ```json
34
+ {
35
+ "scripts": {
36
+ "lint": "eslint .",
37
+ "lint:fix": "eslint . --fix"
38
+ }
39
+ }
40
+ ```
package/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import type { Awaitable, OptionsConfig, TypedFlatConfigItem } from '@antfu/eslint-config'
2
+ import type { Linter } from 'eslint'
3
+
4
+ export declare function enlighten(
5
+ options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>,
6
+ ...userConfigs: Awaitable<
7
+ | TypedFlatConfigItem
8
+ | TypedFlatConfigItem[]
9
+ | Linter.Config
10
+ | Linter.Config[]
11
+ >[]
12
+ ): Promise<TypedFlatConfigItem[]>
13
+
14
+ export default enlighten
package/index.js ADDED
@@ -0,0 +1,44 @@
1
+ import antfu from '@antfu/eslint-config'
2
+
3
+ /**
4
+ * Factory padronizado de ESLint para os projetos Enspace / Enlighten
5
+ *
6
+ * @param {import('@antfu/eslint-config').OptionsConfig & import('@antfu/eslint-config').TypedFlatConfigItem} options
7
+ * @param {...(import('@antfu/eslint-config').TypedFlatConfigItem | import('@antfu/eslint-config').TypedFlatConfigItem[])} userConfigs
8
+ */
9
+ export function enlighten(options = {}, ...userConfigs) {
10
+ const {
11
+ rules = {},
12
+ ignores = [],
13
+ markdown = false,
14
+ ...restOptions
15
+ } = options
16
+
17
+ const defaultIgnores = [
18
+ '**/dist/**',
19
+ '**/node_modules/**',
20
+ '**/.turbo/**',
21
+ '**/coverage/**',
22
+ '**/.output/**',
23
+ '**/.nuxt/**',
24
+ ...ignores,
25
+ ]
26
+
27
+ const defaultRules = {
28
+ 'ts/consistent-type-definitions': ['error', 'interface'],
29
+ 'vue/custom-event-name-casing': 'off',
30
+ ...rules,
31
+ }
32
+
33
+ return antfu(
34
+ {
35
+ markdown,
36
+ ignores: defaultIgnores,
37
+ rules: defaultRules,
38
+ ...restOptions,
39
+ },
40
+ ...userConfigs,
41
+ )
42
+ }
43
+
44
+ export default enlighten
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@be-enlighten/eslint-config",
3
+ "type": "module",
4
+ "version": "0.2.0",
5
+ "description": "Configuração unificada de ESLint para os projetos Enspace / Enlighten",
6
+ "license": "MIT",
7
+ "main": "./index.js",
8
+ "types": "./index.d.ts",
9
+ "files": [
10
+ "README.md",
11
+ "index.d.ts",
12
+ "index.js"
13
+ ],
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "peerDependencies": {
18
+ "eslint": ">=9.0.0"
19
+ },
20
+ "dependencies": {
21
+ "@antfu/eslint-config": "^9.5.1"
22
+ },
23
+ "scripts": {
24
+ "typecheck": "tsc --noEmit"
25
+ }
26
+ }