Giter Site home page Giter Site logo

frontend-checks's Introduction

Frontend checks

Installing this package

Install this package as a development dependency npm i -D @leukeleu/frontend-checks.

Adding the configs

Prettier

In your prettier.config.js add:

module.exports = require('@leukeleu/frontend-checks').prettier

Stylelint

In your stylelint.config.js add:

module.exports = require('@leukeleu/frontend-checks').stylelint

Eslint

In your .eslintrc.js add:

module.exports = require('@leukeleu/frontend-checks').eslint

Extending configs

Be careful here. Please read this whole section as you may overwrite configuration.

The configs are in JavaScript, so you can make use of the spread operator to extend the config.

module.exports = {
  ...require('@leukeleu/frontend-checks').eslint,
  rules: {
    eqeqeq: 'off',
  },
}

This however will overwrite the whole key 'rules' if rules is defined in the frontend-checks config.

If you only want to add or overwrite a rule you can extend the rules also.

const config = require('@leukeleu/frontend-checks').eslint

module.exports = {
  ...config,
  rules: {
    ...config.rules
    eqeqeq: 'off',
  },
}

This will keep the rules of the config if they are defined and add your own config on top of it.

Note: Sadly we can't use the Eslint 'extends' in the example above as we need to rename our package to '@leukeleu/eslint-config' to do so. This will also not help for extending Prettier and Stylelint config.

Testing this package

To reduce the chances of publishing bugs, test your package before publishing it to the npm registry. Run npm install with the full path to your package directory. You can get this path with pwd in your terminal.

npm install <local path to this repo>

frontend-checks's People

Contributors

twesterhuis avatar

Watchers

Dennis Bunskoek avatar Bart Heesink avatar Bram Simons avatar James Cloos avatar Ramon de Jezus avatar  avatar Thomas Kalverda avatar

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.