All Projects → marcelmokos → eslint-config-with-prettier

marcelmokos / eslint-config-with-prettier

Licence: MIT license
Eslint config with prettier

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to eslint-config-with-prettier

react-typescript
React16 + HMR + typescript + webpack + tslint + tests
Stars: ✭ 21 (-46.15%)
Mutual labels:  yarn, enzyme, editorconfig
js-stack-from-scratch
🌺 Russian translation of "JavaScript Stack from Scratch" from the React-Theming developers https://github.com/sm-react/react-theming
Stars: ✭ 394 (+910.26%)
Mutual labels:  yarn, enzyme
coconat
🍥 StarterKit Builder for rocket-speed App creation on 🚀 React 17 + 📙 Redux 4 + 🚠 Router 5 + 📪 Webpack 5 + 🎳 Babel 7 + 📜 TypeScript 4 + 🚔 Linters 23 + 🔥 HMR 3
Stars: ✭ 95 (+143.59%)
Mutual labels:  yarn, enzyme
generator-react-web
Yeoman generator for creating interactive web sites with React and Redux + Webpack, Flow, ES7+, Babel, Yarn, npm Scripts, i18n, Redux Saga, SCSS, CSS Modules
Stars: ✭ 35 (-10.26%)
Mutual labels:  yarn, npm-scripts
Simple React App
Simple base app using react, react-router v4, hot-reload & sass.
Stars: ✭ 263 (+574.36%)
Mutual labels:  yarn, enzyme
eslint-config-typescript-unified
🛠️ A unified ESLint configuration with sensible defaults for TypeScript projects.
Stars: ✭ 15 (-61.54%)
Mutual labels:  airbnb, eslint-config
eslint-config-welly
😎 ⚙️ ESLint configuration for React projects that I do. Feel free to use this!
Stars: ✭ 21 (-46.15%)
Mutual labels:  airbnb, eslint-config
Npm Script Naming Ideas
Ideas for naming npm scripts
Stars: ✭ 12 (-69.23%)
Mutual labels:  yarn, npm-scripts
Yarpm
CLI tool to run npm scripts with either npm or yarn, depending on how it was started
Stars: ✭ 13 (-66.67%)
Mutual labels:  yarn, npm-scripts
eslint-config-fullstack
A complete ESLint config file to help students avoid errors and learn best practices
Stars: ✭ 16 (-58.97%)
Mutual labels:  eslint-config, eslintrc
docker-rails-demo
Demo app for Rails, Docker and Webpack
Stars: ✭ 29 (-25.64%)
Mutual labels:  yarn
react-native-surrender
CLI script that clears Watchman, removes node_modules and cleans cache using npm or yarn
Stars: ✭ 53 (+35.9%)
Mutual labels:  yarn
react-webpack2-skeleton
Get started with React with Webpack2, React-Router, Redux, Code Splitting and Server Rendering
Stars: ✭ 59 (+51.28%)
Mutual labels:  yarn
burrow
Burrow is an online booking platform / software for Real estate marketplace (Realty marketplace), Rental booking, Room sharing, Hotel booking, Office/Parking Space sharing, Car sharing, Bike sharing, Boat sharing, and other Airbnb clones like finder, etc
Stars: ✭ 45 (+15.38%)
Mutual labels:  airbnb
yarn-outdated-formatter
yarn outdated --json formatter
Stars: ✭ 31 (-20.51%)
Mutual labels:  yarn
react-testing-mocha-chai-enzyme
A solid test setup for React components with Mocha, Chai, Sinon, Enzyme in a Webpack/Babel application.
Stars: ✭ 48 (+23.08%)
Mutual labels:  enzyme
SharedInfrastructure
Centralized infrastructure elements for SixLabors projects. (msbuild, linting, shared internals)
Stars: ✭ 19 (-51.28%)
Mutual labels:  editorconfig
wemake-frontend-styleguide
Set of the strictest linters for your next frontend app
Stars: ✭ 67 (+71.79%)
Mutual labels:  eslint-config
ra-input-markdown
A markdown editor for react-admin
Stars: ✭ 22 (-43.59%)
Mutual labels:  yarn
editorconfig-checker.javascript
A tool to verify that your files are in harmony with your .editorconfig
Stars: ✭ 59 (+51.28%)
Mutual labels:  editorconfig

eslint-config-with-prettier

npm version styled with prettier Build Status dependency devDep Known Vulnerabilities

This package provides Airbnb's .eslintrc.yml with prettier as an extensible shared config.

  • If you do not want to install and setup eslint with all configs and plugins.
  • Install and extend eslint-config-with-prettier it works as create-react-app but for eslint, linting with prettier.

Usage

1. install config

yarn add --dev eslint-config-with-prettier

or

npm install --dev eslint-config-with-prettier

2. extend config

  • .eslintrc.yml
extends:
  - eslint-config-with-prettier
  • .eslintrc.js
module.exports = {
  extends: ["eslint-config-with-prettier"],
};
  • .eslintrc.json
{
  "extends": ["eslint-config-with-prettier"]
}

You can expect

  • linting using eslint
  • extended Airbnb config
  • pretty printing using prettier on eslint --fix
  • bash script for additional setup

Tools:

Configs:

Plugins:

adding support to eslint-plugin-dollar-sign

  • helpful for ES6 code that uses jQuery
extends:
  - eslint-config-with-prettier
plugins:
  # https://github.com/erikdesjardins/eslint-plugin-dollar-sign
  - dollar-sign
rules:
  # Require dollar sign for some variables that holds jQuery objects
  dollar-sign/dollar-sign:
    - error
    - ignoreProperties
  • .eslintrc.js
module.exports = {
  extends: ["eslint-config-with-prettier"],
  plugins: ["dollar-sign"],
  rules: {
    "dollar-sign/dollar-sign": ["error", "ignoreProperties"],
  },
};
  • .eslintrc.json
{
  "extends": ["eslint-config-with-prettier"],
  "plugins": ["dollar-sign"],
  "rules": {
    "dollar-sign/dollar-sign": ["error", "ignoreProperties"]
  }
}

running setup script

!!!on your own risk!!!, commit before running the script and control the output using diff in version control.

setup.sh that run gist example

bash ./node_modules/eslint-config-with-prettier/setup.sh

If you do not want to run the bash script you can simply copy files into your project.

This script adds useful files into your project.

"scripts": {
  "test": "jest",
  "test:changed": "yarn test --onlyChanged --passWithNoTests --silent --runInBand",
  "test:watch": "yarn test --watch",
  "test:update": "yarn test --update",
  "test:coverage": "yarn test --coverage --verbose --silent --runInBand --passWithNoTests",
  "lint": "eslint . --cache",
  "lint:fix": "yarn lint --fix",
  "lint:staged": "eslint --fix --max-warnings=0",
  "precommit": "lint-staged && yarn test:changed",
  "prepush": "yarn test:coverage",
  "prettier": "prettier --write *.{js,jsx,html,md,mdx,yaml,json,css,scss,less}",
},
"husky": {
  "hooks": {
    "pre-commit": "yarn precommit",
    "pre-push": "yarn prepush"
  }
},
"lint-staged": {
  "linters": {
    "*.{js,jsx}": [
      "yarn run lint:staged",
      "git add"
    ],
    "*.{json,css,scss,less}": [
      "prettier --write",
      "git add"
    ],
    "*.{png,jpeg,jpg,gif,svg}": [
      "imagemin-lint-staged",
      "git add"
    ]
  }
}
"scripts": {
  "flow:setup": "yarn && flow-typed install",
  "flow:update": "flow-typed update",
  "flow": "flow",
  "flow:errors": "flow --show-all-errors",
  "flow:coverage": "flow coverage ./src/index.js --color && flow-coverage-report -i src/**/*.js -x src/**/*.test.js -x src/**/*.spec.js -t html",
  "prepush": "yarn test:coverage && yarn run flow:errors"
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].