Skip to content

Commit

Permalink
Merge pull request #1 from Scalefast/rules-and-readme-cleanup
Browse files Browse the repository at this point in the history
Rules update and readme cleanup
  • Loading branch information
ana-ac authored Jul 18, 2019
2 parents 9508029 + cafa5b6 commit ce58cfc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 42 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

[![npm version](https://badge.fury.io/js/eslint-config-scalefast.svg)](https://badge.fury.io/js/eslint-config-scalefast)

Eslint config we use and extend at Scalefast as a shareable configuration https://eslint.org/docs/developer-guide/shareable-configs
Eslint config we use and extend at Scalefast as a [shareable configuration](https://eslint.org/docs/developer-guide/shareable-configs)

To be continued...
## Rules

We extend [eslint:recommended](https://eslint.org/docs/rules/) and build an opinionated set of rules on top of it,
check index.js for the complete list.

All the rules in this package have 2 purposes.

* Enable all rules that prevent bugs and bad practices. Rules like [Disallow self compare](https://eslint.org/docs/rules/no-self-compare) can prevent hard to spot mistakes
* Enforcing a consistent visual style for new and old code without forcing large rewrites

The large number of rules we enable for these reasons may cause a number of issues in projects that didn't
follow them from the start, in these cases some rules can be changed from "error" to "warn" enabling us to do a more gradual refactor. Temporarily disabling style related rules will also make easier to spot the most serious issues first.

## Contributing

We are open to add, modify or remove rules if you provide a reasoning behind the changes. Create a PR with the proposed changes in [Github](https://github.com/scalefast/editor-tools-scalefast) and provide an example of the effects it will have on a small code sample.

Take into account that some of the visual rules are not better or worse than any other convention but changing them would force many changes that don't add value.

If you are doing a new project at Scalefast and need a different set of rules for any reason tell us about it, we can see if it can be integrated with our current configuration or has to be kept separated. In any case this repository is a great place to have reusable configurations and avoid duplication.
40 changes: 1 addition & 39 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
'plugins': [
'promise'
],
'extends': 'eslint:recommended',
'globals': {
'document': false,
'window': false,
Expand Down Expand Up @@ -67,7 +68,6 @@ module.exports = {
'error',
'last'
],
'constructor-super': 'error',
'curly': [
'error',
'multi-line'
Expand Down Expand Up @@ -189,14 +189,8 @@ module.exports = {
],
'no-floating-decimal': 'error',
'no-func-assign': 'error',
'no-global-assign': 'error',
'no-implied-eval': 'error',
'no-inner-declarations': [
'error',
'functions'
],
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': [
Expand Down Expand Up @@ -233,7 +227,6 @@ module.exports = {
'allowSamePrecedence': true
}
],
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-multiple-empty-lines': [
Expand All @@ -248,43 +241,29 @@ module.exports = {
'no-new-func': 'error',
'no-new-object': 'error',
'no-new-require': 'error',
'no-new-symbol': 'error',
'no-new-wrappers': 'error',
'no-obj-calls': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-path-concat': 'error',
'no-proto': 'error',
'no-redeclare': 'error',
'no-regex-spaces': 'error',
'no-return-assign': [
'error',
'except-parens'
],
'no-return-await': 'error',
'no-self-assign': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-shadow-restricted-names': 'error',
'no-sparse-arrays': 'error',
'no-tabs': 'error',
'no-template-curly-in-string': 'error',
'no-this-before-super': 'error',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-unexpected-multiline': 'error',
'no-unmodified-loop-condition': 'error',
'no-unneeded-ternary': [
'error',
{
'defaultAssignment': false
}
],
'no-unreachable': 'error',
'no-unsafe-finally': 'error',
'no-unsafe-negation': 'error',
'no-unused-expressions': [
'error',
{
Expand Down Expand Up @@ -312,11 +291,9 @@ module.exports = {
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-constructor': 'error',
'no-useless-escape': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-whitespace-before-property': 'error',
'no-with': 'error',
'object-curly-spacing': [
'error',
'always',
Expand Down Expand Up @@ -355,14 +332,6 @@ module.exports = {
}
],
'prefer-promise-reject-errors': 'error',
'quotes': [
'error',
'single',
{
'avoidEscape': true,
'allowTemplateLiterals': true
}
],
'rest-spread-spacing': [
'error',
'never'
Expand Down Expand Up @@ -440,13 +409,6 @@ module.exports = {
'error',
'never'
],
'use-isnan': 'error',
'valid-typeof': [
'error',
{
'requireStringLiterals': true
}
],
'wrap-iife': [
'error',
'inside',
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-scalefast",
"version": "0.0.1",
"version": "1.0.0",
"description": "Eslint config we use and extend at Scalefast as a shareable configuration https://eslint.org/docs/developer-guide/shareable-configs",
"main": "index.js",
"scripts": {
Expand All @@ -19,6 +19,9 @@
"eslint-plugin-promise": ">= 4.0"
},
"author": "Mario Marinero <[email protected]>",
"contributors": [
"Ana Arriaga <[email protected]>"
],
"license": "ISC",
"bugs": {
"url": "https://github.com/scalefast/eslint-config-scalefast/issues"
Expand Down

0 comments on commit ce58cfc

Please sign in to comment.