Skip to content

Commit

Permalink
5.2.0 (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
henriqueleite42 authored Jan 4, 2022
1 parent a832f21 commit 050bb49
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 16 deletions.
16 changes: 11 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,21 @@

// Code Spell Checker
"cSpell.words": [
"techmmunity",
"nextjs",
"sonarjs",
"backreference",
"camelcase",
"dbaeumer",
"eqeqeq",
"eslintconfig",
"styleguide",
"Guilded",
"iife",
"mischeck",
"nextjs",
"nonoctal",
"passhref",
"polyfillio",
"rushstack",
"Guilded"
"sonarjs",
"styleguide",
"techmmunity"
]
}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

### Dependencies

## [5.2.0] - 2022-01-03

### Added

- `@typescript-eslint/consistent-type-imports` rule

### Changed

- Improve `import-helpers/order-imports` config
- Improve `jest/require-top-level-describe` config

### Fixed

### Removed

### Dependencies

## [5.1.3] - 2021-11-16

### Added
Expand Down
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

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.

[![Discord Community](https://img.shields.io/badge/discord%20community-5865F2?style=for-the-badge&labelColor=5865F2&logo=discord&logoColor=ffffff)](https://discord.gg/TakYksUzzZ)
[![Discord Community](https://img.shields.io/badge/discord%20community-5865F2?style=for-the-badge&labelColor=5865F2&logo=discord&logoColor=ffffff)](https://discord.gg/NMtAJ6whG7)

## :warning: WARNING :warning:

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.

## Badges

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

## Install

```sh
yarn add -D @techmmunity/eslint-config eslint prettier
```

**Obs:** If you are using **VSCode**, you may need/want to do some [extra steps](#extra---vscode-tips--tricks).

## Basic Usage

1 - Create a `.eslintrc.json` file in the root of your project

2 - Put the following content inside the file:

```json
{
"root": true,
"extends": "@techmmunity/eslint-config"
}
```

3 - Restart the VSCode, and it's done!

## Need more examples?

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!

## Modules

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

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

## Need more examples?

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!

## Extra - VSCode Tips & Tricks

### See the errors and warnings
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@techmmunity/eslint-config",
"version": "5.1.3",
"version": "5.2.0",
"license": "Apache-2.0",
"author": "Techmmunity",
"description": "Techmmunity Style Guide",
Expand Down
17 changes: 15 additions & 2 deletions src/configs/common.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-useless-escape */
/* eslint-disable no-magic-numbers */

/*
Expand Down Expand Up @@ -45,9 +46,10 @@ module.exports = {
},
},
{
files: ["**/*.spec.js", "**/*.test.js"],
files: ["**/*.spec.{js,ts}", "**/*.test.{js,ts}"],
rules: {
"no-magic-numbers": "off",
"sonarjs/no-duplicate-string": "off",
},
},
],
Expand Down Expand Up @@ -337,7 +339,18 @@ module.exports = {
"import-helpers/order-imports": [
"warn",
{
groups: ["module", ["parent", "sibling", "index"]],
newlinesBetween: "always",
groups: [
"module",
"parent",
["sibling", "index"],
// eslint-disable-next-line prettier/prettier
["/\/enums?\//", "/\/types?\//", "/\/types?.(ts|js)$/"],
],
alphabetize: {
order: "asc",
ignoreCase: true,
},
},
],
},
Expand Down
9 changes: 7 additions & 2 deletions src/configs/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
/**
* Plugin - Jest Formatting
*
* https://github.com/jest-community/eslint-plugin-jest/tree/main/docs/rules
* https://github.com/dangreenisrael/eslint-plugin-jest-formatting/tree/master/docs/rules
*/
"jest-formatting/padding-around-all": "error",
/**
Expand All @@ -32,6 +32,11 @@ module.exports = {
"jest/prefer-to-contain": "error",
"jest/prefer-to-have-length": "error",
"jest/prefer-todo": "error",
"jest/require-top-level-describe": "error",
"jest/require-top-level-describe": [
"error",
{
maxNumberOfTopLevelDescribes: 2,
},
],
},
};
1 change: 1 addition & 0 deletions src/configs/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ module.exports = {
"@typescript-eslint/consistent-indexed-object-style": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/explicit-member-accessibility": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/member-delimiter-style": "error",
Expand Down

0 comments on commit 050bb49

Please sign in to comment.