# eslint-config-happycode **Repository Path**: happycoding-cx/eslint-config-happycode ## Basic Information - **Project Name**: eslint-config-happycode - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-05-23 - **Last Updated**: 2022-05-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Scratch ESLint config [![Greenkeeper badge](https://badges.greenkeeper.io/LLK/eslint-config-happycode.svg)](https://greenkeeper.io/) #### eslint-config-happycode defines the eslint rules used for Scratch Javascript projects ## Installation Install the config along with its peer dependencies, eslint and babel-eslint. ```bash npm install -D eslint-config-happycode eslint@3 babel-eslint@7 ``` If you're using the React config, also install the dependency for that ```bash npm install -D eslint-plugin-react@6 ``` ## Usage The configuration is split up into several modules: * `happycode`: The base configuration. Always extend this. * `happycode/node`: Rules for node, e.g., server-side code, tests, and scripts * `happycode/es6`: Rules for ES6, for use when you're transpiling with webpack * `happycode/react`: Rules for React projects Usually web projects have a mix of node and web environment files. To lint both with the appropriate rules, set up a base `.eslintrc.js` with the rules for node and then override the node configuration in `src` (where web code usually lives). E.g., with a file structure like this: ``` happycode-project - .eslintrc.js - package.json - src - .eslintrc.js - index.js ``` Your config files should be set up like ```javascript // happycode-project/.eslintrc.js module.exports = { extends: ['happycode', 'happycode/es6', 'happycode/node'] }; // happycode-project/src/.eslintrc.js module.exports = { root: true, extends: ['happycode', 'happycode/es6', 'happycode/react'], env: { browser: true } }; ``` This will set up all the files in the project for linting as Node.js by default, except for those in `src/`, which will be linted as ES6 and React files. If you're linting React, also make sure your lint script lints `.jsx` files: ```json "scripts": { "lint": "eslint . --ext .js,.jsx" } ``` ## Committing This project uses [semantic release](https://github.com/semantic-release/semantic-release) to ensure version bumps follow semver so that projects using the config don't break unexpectedly. In order to automatically determine the type of version bump necessary, semantic release expects commit messages to be formatted following [conventional-changelog](https://github.com/bcoe/conventional-changelog-standard/blob/master/convention.md). ``` ():