@t4h.framework/eslint-config 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +7 -0
- package/README.md +26 -2
- package/dist/configs/base.d.ts +3 -0
- package/dist/configs/base.d.ts.map +1 -0
- package/dist/configs/base.js +125 -0
- package/dist/configs/base.js.map +1 -0
- package/dist/configs/jsx.d.ts +3 -0
- package/dist/configs/jsx.d.ts.map +1 -0
- package/dist/configs/jsx.js +22 -0
- package/dist/configs/jsx.js.map +1 -0
- package/dist/eslint-config.d.ts +4 -0
- package/dist/eslint-config.d.ts.map +1 -0
- package/dist/eslint-config.js +4 -0
- package/dist/eslint-config.js.map +1 -0
- package/dist/jsx.d.ts +3 -0
- package/dist/jsx.d.ts.map +1 -0
- package/dist/jsx.js +3 -0
- package/dist/jsx.js.map +1 -0
- package/dist/prettier-config.d.ts +4 -0
- package/dist/prettier-config.d.ts.map +1 -0
- package/dist/prettier-config.js +18 -0
- package/dist/prettier-config.js.map +1 -0
- package/dist/rules/no-comments.d.ts +3 -0
- package/dist/rules/no-comments.d.ts.map +1 -0
- package/dist/rules/no-comments.js +64 -0
- package/dist/rules/no-comments.js.map +1 -0
- package/dist/tools/defineConfig.d.ts +18 -0
- package/dist/tools/defineConfig.d.ts.map +1 -0
- package/dist/tools/defineConfig.js +84 -0
- package/dist/tools/defineConfig.js.map +1 -0
- package/package.json +71 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @t4h.framework/eslint-config
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#238](https://github.com/tech4humans-brasil/framework/pull/238) [`8567806`](https://github.com/tech4humans-brasil/framework/commit/8567806ec537288076c3a18a4816f26d58a67905) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Adds the ESLint and Prettier configuration of the T4H Framework. The default export is the base config, `./jsx` adds the React rules and `./prettier-config` has the Prettier options. `defineConfig()` starts from the base config and adds the `recommended` config of each installed `@t4h.framework/*` package that has an `eslint` entry. The base config includes the `no-comments` rule: a comment needs a disable directive with a reason.
|
package/README.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @t4h.framework/eslint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ESLint and Prettier configuration for the T4H Framework. It also turns on the
|
|
4
|
+
rules of each `@t4h.framework/*` package that the project uses.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```javascript
|
|
9
|
+
// eslint.config.mjs
|
|
10
|
+
import { defineConfig } from '@t4h.framework/eslint-config'
|
|
11
|
+
|
|
12
|
+
export default defineConfig()
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"prettier": "@t4h.framework/eslint-config/prettier-config"
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
| Entry | What it has |
|
|
22
|
+
| ----------------------------------------------- | --------------------------------------------------------- |
|
|
23
|
+
| `@t4h.framework/eslint-config` | The base config (default export) and `defineConfig()` |
|
|
24
|
+
| `@t4h.framework/eslint-config/jsx` | The base config and the React rules for `.jsx` and `.tsx` |
|
|
25
|
+
| `@t4h.framework/eslint-config/prettier-config` | The Prettier options |
|
|
26
|
+
|
|
27
|
+
Peer dependencies: `eslint`, `prettier` and `typescript`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA6BpC,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAiG/B,CAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import cspell from '@cspell/eslint-plugin';
|
|
2
|
+
import js from '@eslint/js';
|
|
3
|
+
import comments from '@eslint-community/eslint-plugin-eslint-comments/configs';
|
|
4
|
+
import vitest from '@vitest/eslint-plugin';
|
|
5
|
+
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
|
|
6
|
+
import { importX } from 'eslint-plugin-import-x';
|
|
7
|
+
import n from 'eslint-plugin-n';
|
|
8
|
+
import prettier from 'eslint-plugin-prettier/recommended';
|
|
9
|
+
import sonarjs from 'eslint-plugin-sonarjs';
|
|
10
|
+
import globals from 'globals';
|
|
11
|
+
import ts from 'typescript-eslint';
|
|
12
|
+
import { noComments } from '../rules/no-comments.js';
|
|
13
|
+
const TYPED_FILES = ['**/*.{ts,tsx,mts,cts}'];
|
|
14
|
+
const TEST_FILES = [
|
|
15
|
+
'**/__tests__/**',
|
|
16
|
+
'**/*.spec.{js,jsx,ts,tsx}',
|
|
17
|
+
'**/*.test.{js,jsx,ts,tsx}',
|
|
18
|
+
];
|
|
19
|
+
const plugin = {
|
|
20
|
+
meta: { name: '@t4h.framework/eslint-config' },
|
|
21
|
+
rules: { 'no-comments': noComments },
|
|
22
|
+
};
|
|
23
|
+
const typed = ts.configs.strictTypeChecked.map(entry => ({
|
|
24
|
+
...entry,
|
|
25
|
+
files: TYPED_FILES,
|
|
26
|
+
}));
|
|
27
|
+
export const base = [
|
|
28
|
+
{ files: ['**/*.{js,mjs,cjs,jsx,ts,tsx,mts,cts}'] },
|
|
29
|
+
{ ignores: ['**/dist/**'] },
|
|
30
|
+
js.configs.recommended,
|
|
31
|
+
importX.flatConfigs.recommended,
|
|
32
|
+
...ts.configs.recommended,
|
|
33
|
+
comments.recommended,
|
|
34
|
+
prettier,
|
|
35
|
+
{
|
|
36
|
+
linterOptions: { reportUnusedDisableDirectives: 'error' },
|
|
37
|
+
plugins: {
|
|
38
|
+
cspell,
|
|
39
|
+
n,
|
|
40
|
+
sonarjs,
|
|
41
|
+
'@t4h.framework/eslint-config': plugin,
|
|
42
|
+
},
|
|
43
|
+
settings: {
|
|
44
|
+
'import-x/resolver-next': [createTypeScriptImportResolver({})],
|
|
45
|
+
},
|
|
46
|
+
languageOptions: {
|
|
47
|
+
ecmaVersion: 'latest',
|
|
48
|
+
sourceType: 'module',
|
|
49
|
+
globals: globals.node,
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
'@t4h.framework/eslint-config/no-comments': 'error',
|
|
53
|
+
'@eslint-community/eslint-comments/require-description': 'error',
|
|
54
|
+
'@eslint-community/eslint-comments/no-unlimited-disable': 'error',
|
|
55
|
+
'@eslint-community/eslint-comments/disable-enable-pair': [
|
|
56
|
+
'error',
|
|
57
|
+
{ allowWholeFile: true },
|
|
58
|
+
],
|
|
59
|
+
'n/prefer-node-protocol': 'error',
|
|
60
|
+
'import-x/order': [
|
|
61
|
+
'error',
|
|
62
|
+
{
|
|
63
|
+
groups: [
|
|
64
|
+
['builtin'],
|
|
65
|
+
['external'],
|
|
66
|
+
['internal'],
|
|
67
|
+
['parent', 'sibling', 'index'],
|
|
68
|
+
],
|
|
69
|
+
pathGroups: [
|
|
70
|
+
{
|
|
71
|
+
pattern: '@t4h.framework/**',
|
|
72
|
+
group: 'external',
|
|
73
|
+
position: 'before',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
pathGroupsExcludedImportTypes: ['builtin'],
|
|
77
|
+
alphabetize: { order: 'asc', caseInsensitive: true },
|
|
78
|
+
'newlines-between': 'always',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
'max-depth': ['error', 2],
|
|
82
|
+
'no-nested-ternary': 'error',
|
|
83
|
+
'no-lonely-if': 'error',
|
|
84
|
+
'no-else-return': ['error', { allowElseIf: false }],
|
|
85
|
+
'sonarjs/cognitive-complexity': ['error', 15],
|
|
86
|
+
'cspell/spellchecker': 'error',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
...typed,
|
|
90
|
+
{
|
|
91
|
+
files: TYPED_FILES,
|
|
92
|
+
languageOptions: {
|
|
93
|
+
parserOptions: { projectService: true },
|
|
94
|
+
},
|
|
95
|
+
rules: {
|
|
96
|
+
'@typescript-eslint/no-deprecated': 'off',
|
|
97
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
98
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
|
|
99
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
100
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
101
|
+
'error',
|
|
102
|
+
{ 'ts-expect-error': 'allow-with-description' },
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
files: TEST_FILES,
|
|
108
|
+
plugins: { vitest },
|
|
109
|
+
rules: {
|
|
110
|
+
'vitest/no-focused-tests': 'error',
|
|
111
|
+
'vitest/no-disabled-tests': 'error',
|
|
112
|
+
'vitest/expect-expect': [
|
|
113
|
+
'error',
|
|
114
|
+
{ assertFunctionNames: ['expect', 'expectTypeOf', 'assertType'] },
|
|
115
|
+
],
|
|
116
|
+
'vitest/no-identical-title': 'error',
|
|
117
|
+
'vitest/valid-expect': 'error',
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
files: ['**/migrations/*.ts'],
|
|
122
|
+
rules: { 'cspell/spellchecker': 'off' },
|
|
123
|
+
},
|
|
124
|
+
];
|
|
125
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/configs/base.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAC1C,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,QAAQ,MAAM,yDAAyD,CAAA;AAC9E,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAE1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,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D,mCAAmC,EAAE;gBACnC,OAAO;gBACP,EAAE,iBAAiB,EAAE,wBAAwB,EAAE;aAChD;SACF;KACF;IACD;QACE,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,EAAE,MAAM,EAAE;QACnB,KAAK,EAAE;YACL,yBAAyB,EAAE,OAAO;YAClC,0BAA0B,EAAE,OAAO;YACnC,sBAAsB,EAAE;gBACtB,OAAO;gBACP,EAAE,mBAAmB,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE;aAClE;YACD,2BAA2B,EAAE,OAAO;YACpC,qBAAqB,EAAE,OAAO;SAC/B;KACF;IACD;QACE,KAAK,EAAE,CAAC,oBAAoB,CAAC;QAC7B,KAAK,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE;KACxC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.d.ts","sourceRoot":"","sources":["../../src/configs/jsx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAOpC,eAAO,MAAM,GAAG,EAAE,MAAM,CAAC,MAAM,EAiB9B,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import react from 'eslint-plugin-react';
|
|
2
|
+
import { base } from './base.js';
|
|
3
|
+
const JSX_FILES = ['**/*.{jsx,tsx}'];
|
|
4
|
+
export const jsx = [
|
|
5
|
+
...base,
|
|
6
|
+
{
|
|
7
|
+
...react.configs.flat.recommended,
|
|
8
|
+
files: JSX_FILES,
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
...react.configs.flat['jsx-runtime'],
|
|
12
|
+
files: JSX_FILES,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
files: JSX_FILES,
|
|
16
|
+
languageOptions: {
|
|
17
|
+
parserOptions: { ecmaFeatures: { jsx: true } },
|
|
18
|
+
},
|
|
19
|
+
settings: { react: { version: 'detect' } },
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
//# sourceMappingURL=jsx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.js","sourceRoot":"","sources":["../../src/configs/jsx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,qBAAqB,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,SAAS,GAAG,CAAC,gBAAgB,CAAC,CAAA;AAEpC,MAAM,CAAC,MAAM,GAAG,GAAoB;IAClC,GAAG,IAAI;IACP;QACE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW;QACjC,KAAK,EAAE,SAAS;KACjB;IACD;QACE,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC;QACpC,KAAK,EAAE,SAAS;KACjB;IACD;QACE,KAAK,EAAE,SAAS;QAChB,eAAe,EAAE;YACf,aAAa,EAAE,EAAE,YAAY,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;SAC/C;QACD,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;KAC3C;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-config.d.ts","sourceRoot":"","sources":["../src/eslint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,cAAc,yBAAyB,CAAA;AAEvC,eAAe,IAAI,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint-config.js","sourceRoot":"","sources":["../src/eslint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAExC,cAAc,yBAAyB,CAAA;AAEvC,eAAe,IAAI,CAAA"}
|
package/dist/jsx.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.d.ts","sourceRoot":"","sources":["../src/jsx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAEtC,eAAe,GAAG,CAAA"}
|
package/dist/jsx.js
ADDED
package/dist/jsx.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.js","sourceRoot":"","sources":["../src/jsx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAEtC,eAAe,GAAG,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier-config.d.ts","sourceRoot":"","sources":["../src/prettier-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,QAAA,MAAM,MAAM,EAAE,MAeb,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
experimentalTernaries: false,
|
|
3
|
+
printWidth: 80,
|
|
4
|
+
tabWidth: 2,
|
|
5
|
+
useTabs: false,
|
|
6
|
+
semi: false,
|
|
7
|
+
singleQuote: true,
|
|
8
|
+
quoteProps: 'as-needed',
|
|
9
|
+
jsxSingleQuote: true,
|
|
10
|
+
trailingComma: 'all',
|
|
11
|
+
bracketSpacing: true,
|
|
12
|
+
bracketSameLine: false,
|
|
13
|
+
arrowParens: 'avoid',
|
|
14
|
+
endOfLine: 'lf',
|
|
15
|
+
singleAttributePerLine: false,
|
|
16
|
+
};
|
|
17
|
+
export default config;
|
|
18
|
+
//# sourceMappingURL=prettier-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier-config.js","sourceRoot":"","sources":["../src/prettier-config.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAW;IACrB,qBAAqB,EAAE,KAAK;IAC5B,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,WAAW;IACvB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,KAAK;IACpB,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,KAAK;IACtB,WAAW,EAAE,OAAO;IACpB,SAAS,EAAE,IAAI;IACf,sBAAsB,EAAE,KAAK;CAC9B,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-comments.d.ts","sourceRoot":"","sources":["../../src/rules/no-comments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,IAAI,EAAc,MAAM,QAAQ,CAAA;AAiDnD,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,UA6B7B,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const DIRECTIVE = /^\s*(eslint|global\s|@ts-|prettier-ignore|cspell:|v8 ignore|istanbul ignore)/;
|
|
2
|
+
const EXPORT_TYPES = new Set([
|
|
3
|
+
'ExportNamedDeclaration',
|
|
4
|
+
'ExportDefaultDeclaration',
|
|
5
|
+
]);
|
|
6
|
+
const BODY_TYPES = new Set([
|
|
7
|
+
'BlockStatement',
|
|
8
|
+
'StaticBlock',
|
|
9
|
+
'ArrowFunctionExpression',
|
|
10
|
+
'FunctionExpression',
|
|
11
|
+
]);
|
|
12
|
+
function isDirective(comment) {
|
|
13
|
+
if (comment.type === 'Shebang')
|
|
14
|
+
return true;
|
|
15
|
+
if (comment.type === 'Line' && comment.value.startsWith('/ <reference'))
|
|
16
|
+
return true;
|
|
17
|
+
return DIRECTIVE.test(comment.value);
|
|
18
|
+
}
|
|
19
|
+
function isInsideExport(node) {
|
|
20
|
+
for (let current = node; current; current = current.parent) {
|
|
21
|
+
if (EXPORT_TYPES.has(current.type))
|
|
22
|
+
return true;
|
|
23
|
+
if (BODY_TYPES.has(current.type))
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
function documentsExport(sourceCode, comment) {
|
|
29
|
+
if (comment.type !== 'Block' || !comment.value.startsWith('*'))
|
|
30
|
+
return false;
|
|
31
|
+
const token = sourceCode.getTokenAfter(comment);
|
|
32
|
+
if (!token)
|
|
33
|
+
return false;
|
|
34
|
+
const node = sourceCode.getNodeByRangeIndex(token.range[0]);
|
|
35
|
+
return isInsideExport(node);
|
|
36
|
+
}
|
|
37
|
+
export const noComments = {
|
|
38
|
+
meta: {
|
|
39
|
+
type: 'suggestion',
|
|
40
|
+
docs: {
|
|
41
|
+
description: 'Allows only directives and JSDoc on exported declarations',
|
|
42
|
+
},
|
|
43
|
+
messages: {
|
|
44
|
+
comment: 'Comments are not allowed. Make the code explain itself, or use JSDoc on an exported declaration. If a comment is really necessary, disable this rule on that line and give the reason after "--".',
|
|
45
|
+
},
|
|
46
|
+
schema: [],
|
|
47
|
+
},
|
|
48
|
+
create(context) {
|
|
49
|
+
const { sourceCode } = context;
|
|
50
|
+
return {
|
|
51
|
+
Program() {
|
|
52
|
+
for (const comment of sourceCode.getAllComments()) {
|
|
53
|
+
if (isDirective(comment) || documentsExport(sourceCode, comment))
|
|
54
|
+
continue;
|
|
55
|
+
context.report({
|
|
56
|
+
loc: comment.loc ?? sourceCode.ast.loc,
|
|
57
|
+
messageId: 'comment',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=no-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-comments.js","sourceRoot":"","sources":["../../src/rules/no-comments.ts"],"names":[],"mappings":"AAIA,MAAM,SAAS,GACb,8EAA8E,CAAA;AAEhF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,wBAAwB;IACxB,0BAA0B;CA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M,UAAU,GAAoB;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,2DAA2D;SACzE;QACD,QAAQ,EAAE;YACR,OAAO,EACL,mMAAmM;SACtM;QACD,MAAM,EAAE,EAAE;KACX;IACD,MAAM,CAAC,OAAO;QACZ,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;QAE9B,OAAO;YACL,OAAO;gBACL,KAAK,MAAM,OAAO,IAAI,UAAU,CAAC,cAAc,EAAE,EAAE,CAAC;oBAClD,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC;wBAC9D,SAAQ;oBAEV,OAAO,CAAC,MAAM,CAAC;wBACb,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG;wBACtC,SAAS,EAAE,SAAS;qBACrB,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;SACF,CAAA;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* Options of {@link defineConfig}.
|
|
4
|
+
*/
|
|
5
|
+
export interface DefineConfigOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The folder of the project `package.json`. Defaults to `process.cwd()`.
|
|
8
|
+
*/
|
|
9
|
+
cwd?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Builds the ESLint config of a project. It starts from the base config, or
|
|
13
|
+
* the JSX config when a package with JSX templates is installed, and appends
|
|
14
|
+
* the `recommended` config of each installed `@t4h.framework/*` package that
|
|
15
|
+
* has an `eslint` entry.
|
|
16
|
+
*/
|
|
17
|
+
export declare function defineConfig(options?: DefineConfigOptions): Promise<Linter.Config[]>;
|
|
18
|
+
//# sourceMappingURL=defineConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineConfig.d.ts","sourceRoot":"","sources":["../../src/tools/defineConfig.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAuBpC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAqED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAa1B"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
4
|
+
import { base } from '../configs/base.js';
|
|
5
|
+
import { jsx } from '../configs/jsx.js';
|
|
6
|
+
const SCOPE = '@t4h.framework/';
|
|
7
|
+
const ESLINT_ENTRY = './eslint';
|
|
8
|
+
const JSX_PACKAGES = new Set(['@t4h.framework/pdf']);
|
|
9
|
+
async function readPackageJson(directory) {
|
|
10
|
+
try {
|
|
11
|
+
const content = await fs.readFile(path.join(directory, 'package.json'), 'utf8');
|
|
12
|
+
return JSON.parse(content);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (error.code === 'ENOENT')
|
|
16
|
+
return undefined;
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
async function readFrameworkDependencies(cwd) {
|
|
21
|
+
const packageJson = await readPackageJson(cwd);
|
|
22
|
+
const names = Object.keys({
|
|
23
|
+
...packageJson?.dependencies,
|
|
24
|
+
...packageJson?.devDependencies,
|
|
25
|
+
});
|
|
26
|
+
return names.filter(name => name.startsWith(SCOPE)).sort();
|
|
27
|
+
}
|
|
28
|
+
async function findInstalledPackage(cwd, name) {
|
|
29
|
+
for (let directory = cwd;; directory = path.dirname(directory)) {
|
|
30
|
+
const packageDirectory = path.join(directory, 'node_modules', name);
|
|
31
|
+
const packageJson = await readPackageJson(packageDirectory);
|
|
32
|
+
if (packageJson)
|
|
33
|
+
return { packageDirectory, packageJson };
|
|
34
|
+
if (path.dirname(directory) === directory)
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function toImportPath(target) {
|
|
39
|
+
if (typeof target === 'string')
|
|
40
|
+
return target;
|
|
41
|
+
const file = target?.import ?? target?.default;
|
|
42
|
+
return typeof file === 'string' ? file : undefined;
|
|
43
|
+
}
|
|
44
|
+
function isPackageEslintEntry(value) {
|
|
45
|
+
if (typeof value !== 'object' || value === null)
|
|
46
|
+
return false;
|
|
47
|
+
if (!('configs' in value))
|
|
48
|
+
return false;
|
|
49
|
+
const { configs } = value;
|
|
50
|
+
if (typeof configs !== 'object' || configs === null)
|
|
51
|
+
return false;
|
|
52
|
+
return Array.isArray(configs.recommended);
|
|
53
|
+
}
|
|
54
|
+
async function loadPackageConfig(cwd, name) {
|
|
55
|
+
const installed = await findInstalledPackage(cwd, name);
|
|
56
|
+
if (!installed)
|
|
57
|
+
return [];
|
|
58
|
+
const file = toImportPath(installed.packageJson.exports?.[ESLINT_ENTRY]);
|
|
59
|
+
if (!file)
|
|
60
|
+
return [];
|
|
61
|
+
const url = pathToFileURL(path.join(installed.packageDirectory, file));
|
|
62
|
+
const module = (await import(url.href));
|
|
63
|
+
if (!isPackageEslintEntry(module.default))
|
|
64
|
+
throw new Error(`${name}/eslint does not export configs.recommended`);
|
|
65
|
+
return module.default.configs.recommended;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Builds the ESLint config of a project. It starts from the base config, or
|
|
69
|
+
* the JSX config when a package with JSX templates is installed, and appends
|
|
70
|
+
* the `recommended` config of each installed `@t4h.framework/*` package that
|
|
71
|
+
* has an `eslint` entry.
|
|
72
|
+
*/
|
|
73
|
+
export async function defineConfig(options = {}) {
|
|
74
|
+
const cwd = options.cwd ?? process.cwd();
|
|
75
|
+
const names = await readFrameworkDependencies(cwd);
|
|
76
|
+
const packageConfigs = await Promise.all(names.map(name => loadPackageConfig(cwd, name)));
|
|
77
|
+
const root = names.some(name => JSX_PACKAGES.has(name)) ? jsx : base;
|
|
78
|
+
return [
|
|
79
|
+
...root,
|
|
80
|
+
{ languageOptions: { parserOptions: { tsconfigRootDir: cwd } } },
|
|
81
|
+
...packageConfigs.flat(),
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=defineConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineConfig.js","sourceRoot":"","sources":["../../src/tools/defineConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAA;AACjC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAEvC,MAAM,KAAK,GAAG,iBAAiB,CAAA;AAE/B,MAAM,YAAY,GAAG,UAAU,CAAA;AAE/B,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAA;AAwBpD,KAAK,UAAU,eAAe,CAAC,SAAiB;IAC9C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAC/B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,EACpC,MAAM,CACP,CAAA;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAgB,CAAA;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAA;QACxE,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC;AAED,KAAK,UAAU,yBAAyB,CAAC,GAAW;IAClD,MAAM,WAAW,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AAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAChD,CAAA;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IAEpE,OAAO;QACL,GAAG,IAAI;QACP,EAAE,eAAe,EAAE,EAAE,aAAa,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE;QAChE,GAAG,cAAc,CAAC,IAAI,EAAE;KACzB,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,74 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t4h.framework/eslint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "ESLint and Prettier configuration for the T4H Framework",
|
|
5
|
+
"homepage": "https://github.com/tech4humans-brasil/framework/tree/main/packages/eslint-config",
|
|
6
|
+
"bugs": "https://github.com/tech4humans-brasil/framework/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/tech4humans-brasil/framework.git",
|
|
10
|
+
"directory": "packages/eslint-config"
|
|
11
|
+
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Tech4Humans <contact@tech4h.com.br> (https://tech4h.com.br)",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/eslint-config.d.ts",
|
|
18
|
+
"import": "./dist/eslint-config.js"
|
|
19
|
+
},
|
|
20
|
+
"./jsx": {
|
|
21
|
+
"types": "./dist/jsx.d.ts",
|
|
22
|
+
"import": "./dist/jsx.js"
|
|
23
|
+
},
|
|
24
|
+
"./prettier-config": {
|
|
25
|
+
"types": "./dist/prettier-config.d.ts",
|
|
26
|
+
"import": "./dist/prettier-config.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"module": "./dist/eslint-config.js",
|
|
30
|
+
"types": "./dist/eslint-config.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc --project tsconfig.build.json",
|
|
37
|
+
"check-types": "tsc --noEmit",
|
|
38
|
+
"check-package": "publint --strict && attw --pack . --profile esm-only",
|
|
39
|
+
"lint": "eslint . --max-warnings 0",
|
|
40
|
+
"prepublishOnly": "yarn build",
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"test:watch": "vitest"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@cspell/eslint-plugin": "^9.7.0",
|
|
46
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.8.1",
|
|
47
|
+
"@eslint/js": "^10.0.1",
|
|
48
|
+
"@vitest/eslint-plugin": "^1.6.27",
|
|
49
|
+
"eslint-config-prettier": "^10.1.8",
|
|
50
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
51
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
52
|
+
"eslint-plugin-n": "^17.23.2",
|
|
53
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
54
|
+
"eslint-plugin-react": "^7.37.5",
|
|
55
|
+
"eslint-plugin-sonarjs": "^4.2.2",
|
|
56
|
+
"globals": "^15.15.0",
|
|
57
|
+
"typescript-eslint": "^8.55.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"eslint": "^10.0.2",
|
|
61
|
+
"prettier": "^3.8.1",
|
|
62
|
+
"typescript": "^5.9.3",
|
|
63
|
+
"vitest": "^4.0.18"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"eslint": ">=10.0.0",
|
|
67
|
+
"prettier": ">=3.0.0",
|
|
68
|
+
"typescript": ">=5.0.0 <6.0.0"
|
|
69
|
+
},
|
|
70
|
+
"packageManager": "yarn@4.12.0",
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=22"
|
|
73
|
+
}
|
|
6
74
|
}
|