Coder Social home page Coder Social logo

bih / web-scripts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spotify/web-scripts

1.0 2.0 0.0 3.82 MB

A collection of base configs and CLI wrappers used to speed up development @ Spotify.

License: Apache License 2.0

JavaScript 51.67% TypeScript 47.26% Shell 1.08%

web-scripts's Introduction

web-scripts

A collection of base configs and CLI wrappers used to speed up development @ Spotify.

About this project

Five of the projects in this repo are shared configurations for common tools we use for building, linting, and formatting our code. They can be installed separately and used by anyone should they opt to follow our standards. We have a specialized point-of-view on what belongs in our configs.

We also combine the above packages and wrap them as a CLI called web-scripts. This library is most useful for buidling and deploying npm packages. It is inspired by react-scripts.

Methodology

We have a few guiding principles for this project.

  1. Style rules should be auto-fixable and if you can, errors should be linted ahead of runtime.
  2. Avoid enforcing code style in static analysis; search for bugs with static analysis, and let auto-formatting deal with code style.
  3. Push "fast" checks as far left as you can. Optimize for code editors/IDEs fixing issues and enforcing things; write Git hooks that catch things as a failsafe; and use static analysis in CI to prevent bad things from getting into master.
  4. web-scripts is meant to be configurable. We want to avoid the "eject" problem. You should be able to easily take the base configs and extend them in your project.

Related projects we use

  • TypeScript: a superset of JavaScript which we think helps make code readable and less bug-prone.
  • ESLint: used for static code analysis with some auto-fixing.
  • Prettier: use to format code pre-commit and automatically in your editor.
  • Jest: our preferred JavaScript test framework.
  • husky: allows us to hook into git events in a convenient way.
  • lint-staged: allows us to write pre-commit hooks which target specific paths and run a series of commands.

Contributing

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

This project is an opinionated approach to static analysis, code formatting, testing, and publishing. It's the result of consensus between many web engineers inside Spotify, and the default configs will mostly be written by Spotify employees. We may reject PRs to the ESLint config if we don't agree that the rule makes sense as part of our baseline, for example. Use it if it aligns with your needs!

Releasing

For now, we will release this repo manually with fixed versions. To do that, use lerna publish --conventional-commits.

web-scripts's People

Stargazers

 avatar

Watchers

 avatar  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.