Coder Social home page Coder Social logo

luizalabs / gandalf-lint Goto Github PK

View Code? Open in Web Editor NEW
27.0 15.0 6.0 129 KB

Bad Code Shall Not Pass

Home Page: https://www.npmjs.com/package/@softboxlab/eslint-config-gandalf-lint

License: MIT License

JavaScript 100.00%
lint linter linter-config eslint javascript

gandalf-lint's Introduction

npm build size dependencies GitHub

gandalf-lint


Bad Code Shall Not Pass

Install

NPM:

npm install --save-dev eslint @softboxlab/eslint-config-gandalf-lint

Yarn:

yarn add --dev eslint @softboxlab/eslint-config-gandalf-lint

Requirements

Configure

Call the white wizard by creating a .eslintrc file on your root project and writing in it:

{
  "extends": "@softboxlab/eslint-config-gandalf-lint"
}

Remember to add the eslint plugin on your favorite IDE, like this one: ESLint for VSCode

Usage

You can create a script on your package.json file like so:

"scripts": {
  "glint": "eslint --ext .js PROJECT_FOLDER"
}

And use your magic script for shall not pass any bad code:

npm run glint

And with fireworks you can automagically fix some errors:

npm run glint --fix

or using yarn:

yarn glint
yarn glint --fix

Autorun it?

If you don't fell like creating any scripts, feel free to have your files linted on the fly by your IDE (did you remember to install the eslint plugin on your IDE?)



Gandalf approves

Contributors

License

The MIT License (MIT)

Copyright (c) Feross Aboukhadijeh

Copyright (c) 2012 Airbnb

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


This project licence is also MIT.

gandalf-lint's People

Contributors

dependabot[bot] avatar marlonmleite avatar rafaellincoln avatar victormaestri avatar vilaboim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gandalf-lint's Issues

Add rule comma-dangle

"comma-dangle": [ "error", "always-multiline" ],

I'd like to have back this rule, because in git projects, it points a modification on a specific line, just because of the insertion of the comma.

Rule lines-between-class-members

lines-between-class-members

I think this rule was working on this project, but doesn't work anymore.
Could this be re-added (or added)?

Documentação das regras utilizadas

No projeto Juggernaut nós sentimos a falta de uma documentação com as regras que são utilizadas no gandalf-lint, para decidirmos se ele realmente funcionaria para nós.

É possível criar uma documentação assim?

Regras eslint para retornar / adicionar

  • "max-params": ["error", 3],
    Limita o máximo de parâmetros na função, forçando funções que tiverem mais parâmetros a serem tratadas como objects.

  • Voltar com o "comma-dangle": [ "error", "always-multiline" ],

ESLint warning

Last ESLint updates changed some settings and now we have this warning related to Standard config:

(node:5933) [ESLINT_LEGACY_OBJECT_REST_SPREAD] DeprecationWarning: The 'parserOptions.ecmaFeatures.experimentalObjectRestSpread' option is deprecated. Use 'parserOptions.ecmaVersion' instead. (found in "node_modules/eslint-config-standard/index.js")

Maybe a dependencies update will solve it, community is already tracking this warning status:

standard/eslint-config-standard-react#48

Add rule max-params

"max-params": ["error", 3],
Limits the maximum number of parameter of a function, forcing functions that have more than 3 parameters, to be treated as a json object.

Separation of concerns

I strongly recommend separating gandalf-lint in three projects:

  • gandalf-lint-base: gandalf-lint for all JS projects independent of any framework;
  • gandalf-lint-react: gandalf-lint-base + linting for react;
  • gandalf-lint-vue: gandalf-lint-base + linting for vue;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.