├── .eslintrc.js ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── index.js ├── package.json └── samples └── hello-world.js /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./index'); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Dependency directory 7 | node_modules 8 | 9 | # Optional npm cache directory 10 | .npm 11 | 12 | # Optional REPL history 13 | .node_repl_history 14 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Samples 2 | samples 3 | 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | 9 | # Dependency directory 10 | node_modules 11 | 12 | # Optional npm cache directory 13 | .npm 14 | 15 | # Optional REPL history 16 | .node_repl_history 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Jed Watson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

⚠️ Archived

3 |

This repository is archived and is no longer maintained.

4 |

For the latest Keystone release please visit the Keystone website.

5 |
6 |
7 |
8 | 9 | # eslint-config-keystone 10 | 11 | Shareable ESLint Config for Coding Standards used in [KeystoneJS](http://keystonejs.com) 12 | 13 | Note that as of 3.0.0 this package no longer includes the eslint-react plugin or react specific rules, to make it more suitable for projects that don't use React. 14 | 15 | If you are using React in your project, please see [eslint-config-keystone-react](https://github.com/keystonejs/eslint-config-keystone-react) 16 | 17 | ## Installation 18 | 19 | Install eslint-config-keystone as a dev dependency: 20 | 21 | ``` 22 | npm install --save-dev eslint eslint-config-keystone 23 | ``` 24 | 25 | Then add an `.eslintrc` file to your project that extends the `keystone` config: 26 | 27 | ``` 28 | { 29 | "extends": [ 30 | "keystone" 31 | ] 32 | } 33 | ``` 34 | 35 | You can do this from the OS X terminal by running this line in your project folder: 36 | 37 | ``` 38 | echo -e '{\n "extends": [\n "keystone"\n ]\n}' >> .eslintrc 39 | ``` 40 | 41 | Additional configuration can be added to `.eslintrc` that extends or overrides the keystone defaults. 42 | 43 | ## License 44 | 45 | MIT. Copyright (c) 2016 Jed Watson. 46 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parserOptions: { 3 | ecmaFeatures: { 4 | experimentalObjectRestSpread: true, 5 | jsx: true, 6 | }, 7 | ecmaVersion: 8, 8 | sourceType: 'module', 9 | }, 10 | env: { 11 | browser: true, 12 | es6: true, 13 | node: true, 14 | }, 15 | rules: { 16 | 'accessor-pairs': 'error', 17 | 'array-bracket-spacing': 'error', 18 | 'arrow-spacing': ['error', { before: true, after: true }], 19 | 'block-spacing': ['error', 'always'], 20 | 'comma-dangle': ['error', 'always-multiline'], 21 | 'comma-spacing': 'error', 22 | 'comma-style': 'error', 23 | 'computed-property-spacing': 'error', 24 | 'constructor-super': 'error', 25 | 'curly': ['error', 'multi-line'], 26 | 'dot-location': ['error', 'property'], 27 | 'dot-notation': 'error', 28 | 'eol-last': 'error', 29 | 'eqeqeq': ['error', 'allow-null'], 30 | 'func-call-spacing': 'error', 31 | 'generator-star-spacing': ['error', { before: true, after: true }], 32 | 'guard-for-in': 1, 33 | 'indent': ['error', 'tab', { SwitchCase: 1 }], 34 | 'jsx-quotes': ['error', 'prefer-double'], 35 | 'key-spacing': 'error', 36 | 'keyword-spacing': 'error', 37 | 'linebreak-style': 'error', 38 | 'new-parens': 'error', 39 | 'no-array-constructor': 'error', 40 | 'no-caller': 'error', 41 | 'no-class-assign': 'error', 42 | 'no-cond-assign': 'error', 43 | 'no-const-assign': 'error', 44 | 'no-control-regex': 'error', 45 | 'no-debugger': 'error', 46 | 'no-delete-var': 'error', 47 | 'no-dupe-args': 'error', 48 | 'no-dupe-class-members': 'error', 49 | 'no-dupe-keys': 'error', 50 | 'no-duplicate-case': 'error', 51 | 'no-empty-character-class': 'error', 52 | 'no-empty': 'error', 53 | 'no-eval': 'error', 54 | 'no-ex-assign': 'error', 55 | 'no-extend-native': 'error', 56 | 'no-extra-bind': 'error', 57 | 'no-extra-boolean-cast': 'error', 58 | 'no-extra-parens': ['error', 'functions'], 59 | 'no-fallthrough': 'error', 60 | 'no-floating-decimal': 'error', 61 | 'no-func-assign': 'error', 62 | 'no-global-assign': 'error', 63 | 'no-implied-eval': 'error', 64 | 'no-inner-declarations': ['error', 'functions'], 65 | 'no-invalid-regexp': 'error', 66 | 'no-irregular-whitespace': 'error', 67 | 'no-iterator': 'error', 68 | 'no-label-var': 'error', 69 | 'no-labels': 'error', 70 | 'no-lone-blocks': 'error', 71 | 'no-mixed-spaces-and-tabs': 'error', 72 | 'no-multi-spaces': 'error', 73 | 'no-multi-str': 'error', 74 | 'no-multiple-empty-lines': ['error', { max: 2 }], 75 | 'no-new-func': 'error', 76 | 'no-new-object': 'error', 77 | 'no-new-require': 'error', 78 | 'no-new-wrappers': 'error', 79 | 'no-new': 'error', 80 | 'no-obj-calls': 'error', 81 | 'no-octal-escape': 'error', 82 | 'no-octal': 'error', 83 | 'no-proto': 'error', 84 | 'no-redeclare': 'error', 85 | 'no-regex-spaces': 'error', 86 | 'no-return-assign': 'error', 87 | 'no-self-compare': 'error', 88 | 'no-sequences': 'error', 89 | 'no-shadow-restricted-names': 'error', 90 | 'no-sparse-arrays': 'error', 91 | 'no-this-before-super': 'error', 92 | 'no-throw-literal': 'error', 93 | 'no-trailing-spaces': 'error', 94 | 'no-undef-init': 'error', 95 | 'no-undef': 'error', 96 | 'no-unexpected-multiline': 'error', 97 | 'no-unreachable': 'error', 98 | 'no-unsafe-negation': 'error', 99 | 'no-unused-vars': ['error', { args: 'none' }], 100 | 'no-useless-call': 'error', 101 | 'no-with': 'error', 102 | 'object-curly-spacing': ['error', 'always'], 103 | 'one-var': ['error', { initialized: 'never' }], 104 | 'operator-linebreak': ['error', 'before'], 105 | 'quote-props': ['error', 'consistent-as-needed'], 106 | 'quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }], 107 | 'semi-spacing': 'error', 108 | 'semi': 'error', 109 | 'space-before-blocks': 'error', 110 | 'space-before-function-paren': 'error', 111 | 'space-in-parens': 'error', 112 | 'space-infix-ops': 'error', 113 | 'space-unary-ops': 'error', 114 | 'spaced-comment': ['error', 'always', { exceptions: ['!'] }], 115 | 'use-isnan': 'error', 116 | 'valid-typeof': 'error', 117 | 'wrap-iife': ['error', 'any'], 118 | 'yoda': 'error', 119 | }, 120 | }; 121 | 122 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-config-keystone", 3 | "version": "3.0.0", 4 | "description": "Shareable ESLint Config for Keystone's Coding Standards", 5 | "main": "index.js", 6 | "scripts": { 7 | "lint": "eslint .", 8 | "test": "echo \"No tests yet... contribute some?\"" 9 | }, 10 | "devDependencies": { 11 | "eslint": "^3.10.0" 12 | }, 13 | "peerDependencies": { 14 | "eslint": "^3.10.0" 15 | }, 16 | "repository": { 17 | "type": "git", 18 | "url": "git+https://github.com/keystonejs/eslint-config-keystone.git" 19 | }, 20 | "keywords": [ 21 | "eslint", 22 | "keystone", 23 | "keystonejs", 24 | "javascript" 25 | ], 26 | "author": "Jed Watson", 27 | "license": "MIT", 28 | "bugs": { 29 | "url": "https://github.com/keystonejs/eslint-config-keystone/issues" 30 | }, 31 | "homepage": "https://github.com/keystonejs/eslint-config-keystone#readme" 32 | } 33 | -------------------------------------------------------------------------------- /samples/hello-world.js: -------------------------------------------------------------------------------- 1 | const world = { 2 | what: 'world', 3 | log: true, 4 | }; 5 | 6 | function hello ({ what, log }) { 7 | const base = 'hello'; 8 | const str = `${base} ${what}`; 9 | if (log) { 10 | console.log(str); 11 | } 12 | return str; 13 | } 14 | 15 | hello(world); 16 | --------------------------------------------------------------------------------