Skip to content

Commit 050bb49

Browse files
5.2.0 (#231)
1 parent a832f21 commit 050bb49

File tree

7 files changed

+81
-16
lines changed

7 files changed

+81
-16
lines changed

.vscode/settings.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,21 @@
9191

9292
// Code Spell Checker
9393
"cSpell.words": [
94-
"techmmunity",
95-
"nextjs",
96-
"sonarjs",
94+
"backreference",
95+
"camelcase",
9796
"dbaeumer",
97+
"eqeqeq",
9898
"eslintconfig",
99-
"styleguide",
99+
"Guilded",
100+
"iife",
101+
"mischeck",
102+
"nextjs",
103+
"nonoctal",
100104
"passhref",
101105
"polyfillio",
102106
"rushstack",
103-
"Guilded"
107+
"sonarjs",
108+
"styleguide",
109+
"techmmunity"
104110
]
105111
}

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
### Removed
1717

18+
### Dependencies
19+
20+
## [5.2.0] - 2022-01-03
21+
22+
### Added
23+
24+
- `@typescript-eslint/consistent-type-imports` rule
25+
26+
### Changed
27+
28+
- Improve `import-helpers/order-imports` config
29+
- Improve `jest/require-top-level-describe` config
30+
31+
### Fixed
32+
33+
### Removed
34+
35+
### Dependencies
36+
1837
## [5.1.3] - 2021-11-16
1938

2039
### Added

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
In this package, you can find the **Techmmunity Style Guide**. We try to keep a clean and consistent code style, with modern features and using best practices.
1414

15-
[![Discord Community](https://img.shields.io/badge/discord%20community-5865F2?style=for-the-badge&labelColor=5865F2&logo=discord&logoColor=ffffff)](https://discord.gg/TakYksUzzZ)
15+
[![Discord Community](https://img.shields.io/badge/discord%20community-5865F2?style=for-the-badge&labelColor=5865F2&logo=discord&logoColor=ffffff)](https://discord.gg/NMtAJ6whG7)
16+
17+
## :warning: WARNING :warning:
18+
19+
This package may not be updated so often, but it not means that it has been abandoned. We do the config in a way to (almost) never have to touch it again, and we only update the package to add new features, what may don't need to happen so often.
1620

1721
## Badges
1822

@@ -46,14 +50,35 @@ In this package, you can find the **Techmmunity Style Guide**. We try to keep a
4650
- Constant maintenance
4751
- Ready-to-go: You don't need any extra config
4852
- Bye bye prettier: You don't need to be using the prettier extension for VSCode if you have this baby on your project
49-
- Direct support: Join our guilded community and get your questions answered
53+
- Direct support: Join our discord community and get your questions answered
5054

5155
## Install
5256

5357
```sh
5458
yarn add -D @techmmunity/eslint-config eslint prettier
5559
```
5660

61+
**Obs:** If you are using **VSCode**, you may need/want to do some [extra steps](#extra---vscode-tips--tricks).
62+
63+
## Basic Usage
64+
65+
1 - Create a `.eslintrc.json` file in the root of your project
66+
67+
2 - Put the following content inside the file:
68+
69+
```json
70+
{
71+
"root": true,
72+
"extends": "@techmmunity/eslint-config"
73+
}
74+
```
75+
76+
3 - Restart the VSCode, and it's done!
77+
78+
## Need more examples?
79+
80+
We provide an [example repository](https://github.com/techmmunity/eslint-config/tree/master/docs/examples/common), you can give a look at it, or [join our discord community](https://discord.gg/NMtAJ6whG7) and make some questions!
81+
5782
## Modules
5883

5984
**Alert:** After any change at `eslintrc.json` file, you must restart VSCode.
@@ -297,10 +322,6 @@ To disable Prettier, you just need to add this to your vscode configs:
297322

298323
You can access this configs by pressing `Ctrl + Shift + P` and tipping `Preferences: Open Settings (JSON)`.
299324

300-
## Need more examples?
301-
302-
We provide an [example repository](https://github.com/techmmunity/eslint-config/tree/master/docs/examples/common), you can give a look at it, or [join our guilded community](https://guilded.gg/techmmunity) and make some questions!
303-
304325
## Extra - VSCode Tips & Tricks
305326

306327
### See the errors and warnings

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@techmmunity/eslint-config",
3-
"version": "5.1.3",
3+
"version": "5.2.0",
44
"license": "Apache-2.0",
55
"author": "Techmmunity",
66
"description": "Techmmunity Style Guide",

src/configs/common.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-useless-escape */
12
/* eslint-disable no-magic-numbers */
23

34
/*
@@ -45,9 +46,10 @@ module.exports = {
4546
},
4647
},
4748
{
48-
files: ["**/*.spec.js", "**/*.test.js"],
49+
files: ["**/*.spec.{js,ts}", "**/*.test.{js,ts}"],
4950
rules: {
5051
"no-magic-numbers": "off",
52+
"sonarjs/no-duplicate-string": "off",
5153
},
5254
},
5355
],
@@ -337,7 +339,18 @@ module.exports = {
337339
"import-helpers/order-imports": [
338340
"warn",
339341
{
340-
groups: ["module", ["parent", "sibling", "index"]],
342+
newlinesBetween: "always",
343+
groups: [
344+
"module",
345+
"parent",
346+
["sibling", "index"],
347+
// eslint-disable-next-line prettier/prettier
348+
["/\/enums?\//", "/\/types?\//", "/\/types?.(ts|js)$/"],
349+
],
350+
alphabetize: {
351+
order: "asc",
352+
ignoreCase: true,
353+
},
341354
},
342355
],
343356
},

src/configs/jest.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
/**
99
* Plugin - Jest Formatting
1010
*
11-
* https://github.com/jest-community/eslint-plugin-jest/tree/main/docs/rules
11+
* https://github.com/dangreenisrael/eslint-plugin-jest-formatting/tree/master/docs/rules
1212
*/
1313
"jest-formatting/padding-around-all": "error",
1414
/**
@@ -32,6 +32,11 @@ module.exports = {
3232
"jest/prefer-to-contain": "error",
3333
"jest/prefer-to-have-length": "error",
3434
"jest/prefer-todo": "error",
35-
"jest/require-top-level-describe": "error",
35+
"jest/require-top-level-describe": [
36+
"error",
37+
{
38+
maxNumberOfTopLevelDescribes: 2,
39+
},
40+
],
3641
},
3742
};

src/configs/typescript.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ module.exports = {
6565
"@typescript-eslint/consistent-indexed-object-style": "error",
6666
"@typescript-eslint/consistent-type-assertions": "error",
6767
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
68+
"@typescript-eslint/consistent-type-imports": "error",
6869
"@typescript-eslint/explicit-member-accessibility": "error",
6970
"@typescript-eslint/explicit-module-boundary-types": "off",
7071
"@typescript-eslint/member-delimiter-style": "error",

0 commit comments

Comments
 (0)