├── LICENSE ├── .gitignore ├── server.js ├── client.js ├── package.json ├── README.md └── index.js /LICENSE: -------------------------------------------------------------------------------- 1 | Don't be a dick. 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | node_modules 3 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | extends: 'fxa/index', 5 | 6 | rules: { 7 | 'curly': 0, 8 | 'semi': [2, 'never'] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /client.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | extends: 'fxa/index', 5 | 6 | env: { 7 | amd: true, // defines require() and define() as global variables as per the amd spec 8 | browser: true, // browser global variables 9 | mocha: true // adds all of the Mocha testing global variables 10 | }, 11 | 12 | rules: { 13 | 'camelcase': 2, 14 | 'consistent-this': [2, 'self'], 15 | 'strict': [2, 'function'] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-config-fxa", 3 | "description": "ESLint shareable config file for Firefox Accounts projects.", 4 | "version": "2.0.0", 5 | "author": "Peter deHaan (http://nodeexamples.com/)", 6 | "bugs": { 7 | "url": "https://github.com/pdehaan/eslint-config-fxa/issues" 8 | }, 9 | "homepage": "https://github.com/pdehaan/eslint-config-fxa", 10 | "keywords": [ 11 | "eslint", 12 | "eslintconfig", 13 | "fxa" 14 | ], 15 | "license": "WTFPL", 16 | "main": "index.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/pdehaan/eslint-config-fxa.git" 20 | }, 21 | "scripts": { 22 | "test": "standard" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eslint-config-fxa 2 | 3 | ESLint [shareable config](http://eslint.org/docs/developer-guide/shareable-configs) file for Firefox Accounts projects. 4 | 5 | ## Installation: 6 | ``` 7 | $ npm install eslint-config-fxa -D 8 | ``` 9 | (You'll need to install `eslint` dependency into your project as well.) 10 | 11 | ## Usage: 12 | 1. Create an .eslintrc file in your project's root directory. 13 | 2. Add the following content to your project's .eslintrc file: `"extends": "fxa"`. 14 | 3. Run `$ eslint .` (if you have ESLint installed globally, or call via `$ ./node_modules/.bin/eslint .` in your Terminal, or simply `eslint .` if you're using an npm `script` task). 15 | 16 | ## Options: 17 | There are currently three configs: 18 | 19 | 1. `fxa` (usage: `"extends": "fxa"`) — Includes base ESLint [environments](http://eslint.org/docs/user-guide/configuring#specifying-environments) and [rules](http://eslint.org/docs/rules/). 20 | 2. `client` (usage: `"extends": "fxa/client"`) — Overrides base `fxa` config, and adds additional environments for 'amd', 'browser', and 'mocha'. 21 | 3. `server` (usage: `"extends": "fxa/server"`) — Overrides base `fxa` config, and disables the [`semi`](http://eslint.org/docs/rules/semi) rule. 22 | 23 | ## NOTE: 24 | The **eslint-config-fxa@2** module is compatible w/ **eslint@1**. 25 | If you're still using a pre ESLint v1 build, you'll need to stick with **eslint-config-fxa@1**. 26 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | extends: 'eslint:recommended', 5 | 6 | env: { 7 | es6: true, // enable all ECMAScript 6 features except for modules 8 | node: true // Node.js global variables and Node.js-specific rules 9 | }, 10 | rules: { 11 | 'camelcase': 0, 12 | 'comma-dangle': 0, 13 | 'comma-style': [2, 'last'], 14 | 'consistent-return': 0, 15 | 'curly': [2, 'all'], 16 | 'dot-notation': 0, 17 | 'eol-last': 2, 18 | 'eqeqeq': [2, 'allow-null'], 19 | 'global-strict': 0, 20 | 'handle-callback-err': 1, 21 | 'indent': [2, 2], // 2 spaces indentation 22 | 'key-spacing': 0, 23 | 'new-cap': 0, 24 | 'no-cond-assign': [2, 'except-parens'], 25 | 'no-debugger': 2, 26 | 'no-empty': 0, 27 | 'no-eval': 2, 28 | 'no-irregular-whitespace': 2, 29 | 'no-loop-func': 0, 30 | 'no-multi-spaces': 0, 31 | 'no-multiple-empty-lines': [2, {'max': 2}], 32 | 'no-new': 2, 33 | 'no-process-exit': 0, 34 | 'no-script-url': 2, 35 | 'no-sequences': 2, 36 | 'no-shadow': 0, 37 | 'no-spaced-func': 0, 38 | 'no-trailing-spaces': 2, 39 | 'no-undef': 2, 40 | 'no-underscore-dangle': 0, 41 | 'no-unused-vars': [2, {'vars': 'all', 'args': 'none'}], 42 | 'no-use-before-define': [2, 'nofunc'], 43 | 'no-with': 2, 44 | 'quotes': [2, 'single', 'avoid-escape'], 45 | 'semi': [2, 'always'], 46 | 'space-unary-ops': 0, 47 | 'strict': 0, 48 | 'valid-typeof': 2, 49 | 'wrap-iife': 0, 50 | 'yoda': 0 51 | } 52 | } 53 | --------------------------------------------------------------------------------