Skip to content

Commit

Permalink
Enforce (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
PauloMFJ authored Feb 15, 2023
1 parent 97885ac commit 3605df3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ To use, create a `.eslintrc.json` and extend the config:

### Extended ESLint Rules

The idea behind this config is to enforce consistency across all projects. We've tried to keep the rules as minimal as possible, and for the most part simply inherit from the recommended rules of the plugins we use. The main exceptions are when it comes to imports. **Note**: We've purposely only defined rules that are auto fixable, these rules should make it easier to write code, and not get in the way.
The idea behind this config is to enforce consistency across all projects. We've tried to keep the rules as minimal as possible, and for the most part simply inherit from the recommended rules of the plugins we use. The main exceptions are when it comes to the following. **Note**: We've purposely only defined rules that are auto fixable, these rules should make it easier to write code, and not get in the way.

#### [eslint-plugin-unused-imports](https://www.npmjs.com/package/eslint-plugin-unused-imports)

Expand All @@ -108,6 +108,10 @@ This is used to auto fix some common inconsistencies. The following rules have b
- [import/newline-after-import](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md) - Makes sure there’s a newline after the imports.
- [import/no-duplicates](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md) - Merges import statements from the same file.

### Quotes

We enforce the use of "double quotes" when possible. We defined this with the intent of it being applied as a auto-fixable rule to enforce consistency with [prettier](https://prettier.io/docs/en/rationale.html#strings).

## Stylelint

### @buildinams/lint/stylelint
Expand Down
3 changes: 3 additions & 0 deletions eslint/configs/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@ module.exports = {

// Disallow the use of undeclared variables
"no-undef": "error",

// Force the use of double quotes when possible
quotes: ["error", "double"],
},
};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@buildinams/lint",
"description": "BiA's base lint config(s).",
"version": "0.1.1",
"version": "0.2.0",
"license": "MIT",
"author": "Build in Amsterdam <development@buildinamsterdam.com> (https://www.buildinamsterdam.com/)",
"exports": {
Expand Down

0 comments on commit 3605df3

Please sign in to comment.