Skip to content

Commit

Permalink
Add prettier to our eslint configuration (#7)
Browse files Browse the repository at this point in the history
* Add prettier to our eslint configuration
  • Loading branch information
Lewis Chung authored and jnwng committed Mar 28, 2017
1 parent 3b4ff02 commit 0e1512e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 69 deletions.
94 changes: 28 additions & 66 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: 'airbnb',
extends: ['airbnb', 'prettier'],
parser: 'babel-eslint',
env: {
browser: true,
Expand All @@ -9,12 +9,7 @@ module.exports = {
amd: true,
jest: true
},
plugins: [
'react',
'jsx-a11y',
'flowtype',
'coursera'
],
plugins: ['react', 'jsx-a11y', 'flowtype', 'coursera', 'prettier'],
globals: {
environment: true
},
Expand All @@ -30,39 +25,33 @@ module.exports = {
},
rules: {
'accessor-pairs': 2,
'arrow-body-style': [
0,
'as-needed'
],
'arrow-body-style': [0, 'as-needed'],
// TODO: Consider if we want to enable this rule.
'arrow-parens': 0,
'class-methods-use-this': 0,
'comma-dangle': [
0,
'always-multiline'
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore'
}
],
complexity: 0,
'computed-property-spacing': [
2,
'never'
],
'computed-property-spacing': [2, 'never'],
'consistent-return': 1,
'coursera/no-translated-template-strings': 1,
curly: [
1,
'multi-line'
],
curly: [1, 'multi-line'],
'default-case': 1,
'dot-notation': [
1,
{
allowKeywords: true
}
],
'dot-location': [
2,
'property'
],
'dot-location': [2, 'property'],
eqeqeq: 1,
'flowtype/define-flow-type': 1,
'func-names': 0,
Expand All @@ -89,25 +78,19 @@ module.exports = {
'linebreak-style': 2,
'max-len': [
2,
120,
2
],
'new-cap': [
1,
{
capIsNewExceptions: [
'Q',
'API',
'ZeroClipboard'
]
code: 120,
tabWidth: 2,
ignoreStrings: true
}
],
'newline-per-chained-call': [
2,
'new-cap': [
1,
{
ignoreChainWithDepth: 2
capIsNewExceptions: ['Q', 'API', 'ZeroClipboard']
}
],
'newline-per-chained-call': 0,
'no-bitwise': 2,
'no-continue': 2,
'no-div-regex': 2,
Expand Down Expand Up @@ -138,11 +121,7 @@ module.exports = {
'no-warning-comments': [
1,
{
terms: [
'fixme',
'hack',
'xxx'
],
terms: ['fixme', 'hack', 'xxx'],
location: 'start'
}
],
Expand All @@ -153,19 +132,9 @@ module.exports = {
'prefer-template': 0,
strict: 0,
'object-curly-spacing': 0,
'operator-linebreak': [
1,
'after'
],
quotes: [
0,
'single',
'avoid-escape'
],
'quote-props': [
1,
'consistent'
],
'operator-linebreak': [1, 'after'],
quotes: [1, 'single', 'avoid-escape'],
'quote-props': [1, 'consistent'],
'react/jsx-boolean-value': 0,
'react/jsx-filename-extension': [
1,
Expand Down Expand Up @@ -205,11 +174,7 @@ module.exports = {
'render'
],
groups: {
'static-methods': [
'propTypes',
'contextTypes',
'childContextTypes'
],
'static-methods': ['propTypes', 'contextTypes', 'childContextTypes'],
lifecycle: [
'displayName',
'propTypes',
Expand Down Expand Up @@ -242,10 +207,7 @@ module.exports = {
}
],
'sort-vars': 1,
'space-before-function-paren': [
2,
'never'
],
'vars-on-top': 0,
'space-before-function-paren': [2, 'never'],
'vars-on-top': 0
}
}
};
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-coursera",
"version": "0.1.0",
"version": "0.2.0",
"description": "Coursera's approach to JavaScript",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down Expand Up @@ -29,17 +29,23 @@
},
"homepage": "https://github.com/coursera/eslint-plugin-coursera",
"dependencies": {
"eslint-config-airbnb": "^11.2.0",
"babel-eslint": "^6.0.2",
"eslint-config-airbnb": "^11.2.0",
"eslint-config-prettier": "^1.5.0",
"eslint-import-resolver-node": "^0.2.3",
"eslint-plugin-coursera": "0.0.3",
"eslint-plugin-flowtype": "^2.25.0",
"eslint-plugin-graphql": "^0.2.7",
"eslint-plugin-import": "^1.15.0",
"eslint-plugin-jsx-a11y": "^2.2.2",
"eslint-plugin-react": "^6.2.1"
"eslint-plugin-prettier": "^2.0.1",
"eslint-plugin-react": "^6.2.1",
"prettier": "^0.22.0"
},
"peerDependencies": {
"eslint": "^3.5.0"
},
"devDependencies": {
"eslint": "^3.18.0"
}
}

0 comments on commit 0e1512e

Please sign in to comment.