styles

Custom and modern set of rules for eslint and prettier

Downloads
51
Stars
1
Committers
2

Nure Styles

Set of modern JS for React and React Native formatting guides, using ESLint and Prettier.

Installing

Install packages

npm install --dev prettier-config-nure eslint-config nure lint-staged husky

Create a .eslintrc.json file with the following contents

{
  "extends": ["eslint-config-nure"]
}

Next create a .prettierrc.js file with the following contents

module.exports = {
  ...require("prettier-config-nure")
};

And finally add the following lines to your package.json file, if you want to ensure no rules are being ignored using lint-staged (optional).

  "name": "My project",
  "version": "0.1.0",
  "scripts": {
    ...
  },
+  "husky": {
+    "hooks": {
+      "pre-commit": "lint-staged"
+    }
+  },
+  "lint-staged": {
+    "*.{js,jsx}": "eslint --fix",
+    "*.{js,jsx,ts,tsx,md,html,css}": "prettier --write"
+  }

Packages

eslint-config-nure

This package includes a ESLint configuration that extends eslint-config-react-app and adds some extra rules

prettier-config-nure

Prettier configuration compatible with eslint-config-nure

License

MIT