@t4h.framework/eslint-config 0.0.0-stage → 0.2.1
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 +19 -0
- package/LICENSE +21 -0
- package/README.md +45 -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 +66 -0
- package/dist/rules/no-comments.js.map +1 -0
- package/dist/tools/framework.d.ts +24 -0
- package/dist/tools/framework.d.ts.map +1 -0
- package/dist/tools/framework.js +60 -0
- package/dist/tools/framework.js.map +1 -0
- package/package.json +72 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @t4h.framework/eslint-config
|
|
2
|
+
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#276](https://github.com/tech4humans-brasil/framework/pull/276) [`7b38934`](https://github.com/tech4humans-brasil/framework/commit/7b38934e8f9207c98c33afcd76e3a7a4da7e8b14) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - The docs give all the rules of the base config, the import order, the 14 Prettier options and the version ranges of the peers. The Portuguese docs are new.
|
|
8
|
+
|
|
9
|
+
## 0.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#274](https://github.com/tech4humans-brasil/framework/pull/274) [`7d7d4ec`](https://github.com/tech4humans-brasil/framework/commit/7d7d4ec27e55262f3f0353a7253a95e12d24de9b) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - Replaces `defineConfig()` with `framework(options, ...configs)`. The configs of the user come last, so their rules win over the base config and the package configs. The `jsx` option turns the React rules on or off. When it is not set, the JSX config applies only if an installed package declares `requires: { jsx: true }` in its `eslint` entry. The fixed list with `@t4h.framework/pdf` is gone, so JSX turns on only with a `pdf` version that has the `./eslint` entry, or with `jsx: true`. The packages are found with `local-pkg`, so Yarn PnP and pnpm work. A `@t4h.framework/*` package that is in `package.json` but not installed now causes an error, and so does an `eslint` entry that is declared but does not load. `framework()` uses the nearest `package.json` at or above `cwd`. `cspell/spellchecker` is now a warning. `no-comments` has a docs URL and no longer accepts a comment that only starts with the word `eslint`.
|
|
14
|
+
|
|
15
|
+
## 0.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tech for humans
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
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
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
yarn add --dev @t4h.framework/eslint-config eslint prettier typescript
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
// eslint.config.mjs
|
|
16
|
+
import { framework } from '@t4h.framework/eslint-config'
|
|
17
|
+
|
|
18
|
+
export default framework()
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
To add or change rules, put your configs after the options. They come last,
|
|
22
|
+
so they win:
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
export default framework({}, { rules: { 'max-depth': ['error', 3] } })
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"prettier": "@t4h.framework/eslint-config/prettier-config"
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| Entry | What it has |
|
|
35
|
+
| ---------------------------------------------- | --------------------------------------------------------- |
|
|
36
|
+
| `@t4h.framework/eslint-config` | The base config (default export) and `framework()` |
|
|
37
|
+
| `@t4h.framework/eslint-config/jsx` | The base config and the React rules for `.jsx` and `.tsx` |
|
|
38
|
+
| `@t4h.framework/eslint-config/prettier-config` | The Prettier options |
|
|
39
|
+
|
|
40
|
+
Peer dependencies: `eslint` `>=10`, `prettier` `>=3` and `typescript`
|
|
41
|
+
`>=5.0.0 <6.0.0`. The package needs Node.js >= 22.
|
|
42
|
+
|
|
43
|
+
To see the rules that apply to each file, run `npx @eslint/config-inspector`.
|
|
44
|
+
|
|
45
|
+
Read the full documentation on the
|
|
46
|
+
[docs site](https://tech4humans-brasil.github.io/framework/eslint-config/).
|
|
@@ -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': 'warn',
|
|
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,OAAO,CAAC,MAAM,iBAAiB,CAAA;AAC/B,OAAO,QAAQ,MAAM,oCAAoC,CAAA;AACzD,OAAO,OAAO,MAAM,uBAAuB,CAAA;AAC3C,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B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,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,sBAAsB,CAAA;AAEpC,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,sBAAsB,CAAA;AAEpC,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;AAoDnD,eAAO,MAAM,UAAU,EAAE,IAAI,CAAC,UA8B7B,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const DIRECTIVE = /^\s*(eslint-(disable|enable)\b|eslint\s+[\w@/-]+\s*:|global\s|@ts-|prettier-ignore|cspell:|v8 ignore|istanbul ignore)/;
|
|
2
|
+
const DOCS_URL = 'https://tech4humans-brasil.github.io/framework/eslint-config/rules/no-comments';
|
|
3
|
+
const EXPORT_TYPES = new Set([
|
|
4
|
+
'ExportNamedDeclaration',
|
|
5
|
+
'ExportDefaultDeclaration',
|
|
6
|
+
]);
|
|
7
|
+
const BODY_TYPES = new Set([
|
|
8
|
+
'BlockStatement',
|
|
9
|
+
'StaticBlock',
|
|
10
|
+
'ArrowFunctionExpression',
|
|
11
|
+
'FunctionExpression',
|
|
12
|
+
]);
|
|
13
|
+
function isDirective(comment) {
|
|
14
|
+
if (comment.type === 'Shebang')
|
|
15
|
+
return true;
|
|
16
|
+
if (comment.type === 'Line' && comment.value.startsWith('/ <reference'))
|
|
17
|
+
return true;
|
|
18
|
+
return DIRECTIVE.test(comment.value);
|
|
19
|
+
}
|
|
20
|
+
function isInsideExport(node) {
|
|
21
|
+
for (let current = node; current; current = current.parent) {
|
|
22
|
+
if (EXPORT_TYPES.has(current.type))
|
|
23
|
+
return true;
|
|
24
|
+
if (BODY_TYPES.has(current.type))
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
function documentsExport(sourceCode, comment) {
|
|
30
|
+
if (comment.type !== 'Block' || !comment.value.startsWith('*'))
|
|
31
|
+
return false;
|
|
32
|
+
const token = sourceCode.getTokenAfter(comment);
|
|
33
|
+
if (!token)
|
|
34
|
+
return false;
|
|
35
|
+
const node = sourceCode.getNodeByRangeIndex(token.range[0]);
|
|
36
|
+
return isInsideExport(node);
|
|
37
|
+
}
|
|
38
|
+
export const noComments = {
|
|
39
|
+
meta: {
|
|
40
|
+
type: 'suggestion',
|
|
41
|
+
docs: {
|
|
42
|
+
description: 'Allows only directives and JSDoc on exported declarations',
|
|
43
|
+
url: DOCS_URL,
|
|
44
|
+
},
|
|
45
|
+
messages: {
|
|
46
|
+
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 "--".',
|
|
47
|
+
},
|
|
48
|
+
schema: [],
|
|
49
|
+
},
|
|
50
|
+
create(context) {
|
|
51
|
+
const { sourceCode } = context;
|
|
52
|
+
return {
|
|
53
|
+
Program() {
|
|
54
|
+
for (const comment of sourceCode.getAllComments()) {
|
|
55
|
+
if (isDirective(comment) || documentsExport(sourceCode, comment))
|
|
56
|
+
continue;
|
|
57
|
+
context.report({
|
|
58
|
+
loc: comment.loc ?? sourceCode.ast.loc,
|
|
59
|
+
messageId: 'comment',
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
//# 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,uHAAuH,CAAA;AAEzH,MAAM,QAAQ,GACZ,gFAAgF,CAAA;AAElF,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,wBAAwB;IACxB,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,CAAC,MAAM,UAAU,GAAoB;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,2DAA2D;YACxE,GAAG,EAAE,QAAQ;SACd;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,24 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
/**
|
|
3
|
+
* Options of {@link framework}.
|
|
4
|
+
*/
|
|
5
|
+
export interface FrameworkOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The folder where the search for the project `package.json` starts. The
|
|
8
|
+
* nearest `package.json` at or above it is used. Defaults to `process.cwd()`.
|
|
9
|
+
*/
|
|
10
|
+
cwd?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Turns the React rules for `.jsx` and `.tsx` on or off. Defaults to `true`
|
|
13
|
+
* when an installed `@t4h.framework/*` package requires JSX.
|
|
14
|
+
*/
|
|
15
|
+
jsx?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Builds the ESLint config of a project. It starts from the base config, or
|
|
19
|
+
* the JSX config when JSX is on, then appends the `recommended` config of each
|
|
20
|
+
* installed `@t4h.framework/*` package that has an `eslint` entry, and then the
|
|
21
|
+
* configs of the user.
|
|
22
|
+
*/
|
|
23
|
+
export declare function framework(options?: FrameworkOptions, ...userConfigs: (Linter.Config | Linter.Config[])[]): Promise<Linter.Config[]>;
|
|
24
|
+
//# sourceMappingURL=framework.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework.d.ts","sourceRoot":"","sources":["../../src/tools/framework.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAoBpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AA6CD;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,OAAO,GAAE,gBAAqB,EAC9B,GAAG,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,GAClD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAgB1B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { pathToFileURL } from 'node:url';
|
|
2
|
+
import { getPackageInfo, importModule, loadPackageJSON, resolveModule, } from 'local-pkg';
|
|
3
|
+
import { base } from '../configs/base.js';
|
|
4
|
+
import { jsx } from '../configs/jsx.js';
|
|
5
|
+
const SCOPE = '@t4h.framework/';
|
|
6
|
+
const ESLINT_ENTRY = './eslint';
|
|
7
|
+
async function readFrameworkDependencies(cwd) {
|
|
8
|
+
const packageJson = await loadPackageJSON(cwd);
|
|
9
|
+
const names = Object.keys({
|
|
10
|
+
...packageJson?.dependencies,
|
|
11
|
+
...packageJson?.devDependencies,
|
|
12
|
+
});
|
|
13
|
+
return names.filter(name => name.startsWith(SCOPE)).sort();
|
|
14
|
+
}
|
|
15
|
+
function isPackageEslintEntry(value) {
|
|
16
|
+
if (typeof value !== 'object' || value === null)
|
|
17
|
+
return false;
|
|
18
|
+
if (!('configs' in value))
|
|
19
|
+
return false;
|
|
20
|
+
const { configs } = value;
|
|
21
|
+
if (typeof configs !== 'object' || configs === null)
|
|
22
|
+
return false;
|
|
23
|
+
return Array.isArray(configs.recommended);
|
|
24
|
+
}
|
|
25
|
+
async function loadPackageEntry(cwd, name) {
|
|
26
|
+
const paths = [cwd];
|
|
27
|
+
const info = await getPackageInfo(name, { paths });
|
|
28
|
+
if (!info)
|
|
29
|
+
throw new Error(`${name} is in package.json but is not installed. Install the dependencies of the project.`);
|
|
30
|
+
const exports = info.packageJson.exports;
|
|
31
|
+
if (!exports?.[ESLINT_ENTRY])
|
|
32
|
+
return undefined;
|
|
33
|
+
const file = resolveModule(`${name}/eslint`, { paths });
|
|
34
|
+
if (!file)
|
|
35
|
+
throw new Error(`${name}/eslint is declared but does not resolve`);
|
|
36
|
+
const entry = await importModule(pathToFileURL(file).href);
|
|
37
|
+
if (!isPackageEslintEntry(entry))
|
|
38
|
+
throw new Error(`${name}/eslint does not export configs.recommended`);
|
|
39
|
+
return entry;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Builds the ESLint config of a project. It starts from the base config, or
|
|
43
|
+
* the JSX config when JSX is on, then appends the `recommended` config of each
|
|
44
|
+
* installed `@t4h.framework/*` package that has an `eslint` entry, and then the
|
|
45
|
+
* configs of the user.
|
|
46
|
+
*/
|
|
47
|
+
export async function framework(options = {}, ...userConfigs) {
|
|
48
|
+
const cwd = options.cwd ?? process.cwd();
|
|
49
|
+
const names = await readFrameworkDependencies(cwd);
|
|
50
|
+
const results = await Promise.all(names.map(name => loadPackageEntry(cwd, name)));
|
|
51
|
+
const eslintEntries = results.filter(entry => entry !== undefined);
|
|
52
|
+
const isJsx = options.jsx ?? eslintEntries.some(entry => entry.requires?.jsx === true);
|
|
53
|
+
return [
|
|
54
|
+
...(isJsx ? jsx : base),
|
|
55
|
+
{ languageOptions: { parserOptions: { tsconfigRootDir: cwd } } },
|
|
56
|
+
...eslintEntries.flatMap(entry => entry.configs.recommended),
|
|
57
|
+
...userConfigs.flat(),
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework.js","sourceRoot":"","sources":["../../src/tools/framework.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,eAAe,EACf,aAAa,GACd,MAAM,WAAW,CAAA;AAElB,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;AAuB/B,KAAK,UAAU,yBAAyB,CAAC,GAAW;IAClD,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAA;IAC9C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,GAAG,WAAW,EAAE,YAAY;QAC5B,GAAG,WAAW,EAAE,eAAe;KAChC,CAAC,CAAA;IAEF,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;AAC5D,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAC7D,IAAI,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAEvC,MAAM,EAAE,OAAO,EAAE,GAAG,KAA6B,CAAA;IACjD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OA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AC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAC/C,CAAA;IACD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAA;IAClE,MAAM,KAAK,GACT,OAAO,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC,CAAA;IAE1E,OAAO;QACL,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QACvB,EAAE,eAAe,EAAE,EAAE,aAAa,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,EAAE;QAChE,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC;QAC5D,GAAG,WAAW,CAAC,IAAI,EAAE;KACtB,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t4h.framework/eslint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.1",
|
|
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
|
+
"local-pkg": "^1.2.1",
|
|
58
|
+
"typescript-eslint": "^8.55.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"eslint": "^10.0.2",
|
|
62
|
+
"prettier": "^3.8.1",
|
|
63
|
+
"typescript": "^5.9.3",
|
|
64
|
+
"vitest": "^4.0.18"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"eslint": ">=10.0.0",
|
|
68
|
+
"prettier": ">=3.0.0",
|
|
69
|
+
"typescript": ">=5.0.0 <6.0.0"
|
|
70
|
+
},
|
|
71
|
+
"packageManager": "yarn@4.12.0",
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=22"
|
|
74
|
+
}
|
|
6
75
|
}
|