Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint-plugin-prettier (Fix #7) #10

Merged
merged 3 commits into from
Jul 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 7 additions & 57 deletions eslint.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
module.exports = {
extends: ['eslint:recommended', 'plugin:node/recommended'],
extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended'],
rules: {
// override recomennded
'no-console': 'off',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-unused-vars': ['error', { args: 'none' }],
// Possible Errors
'no-extra-parens': ['error', 'all', {
conditionalAssign: false,
returnAssign: false,
nestedBinaryExpressions: false
}],
// Best Practices
'array-callback-return': 'error',
'block-scoped-var': 'error',
'curly': ['error', 'multi-line'],
'dot-location': ['error', 'property'],
'dot-notation': 'error',
/** eqeqeq Deprecated option. @see https://github.com/hexojs/eslint-config-hexo/issues/8 */
'eqeqeq': ['error', 'allow-null'],
Expand All @@ -28,7 +20,6 @@ module.exports = {
'no-implied-eval': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-new': 'error',
'no-new-func': 'error',
Expand All @@ -49,7 +40,6 @@ module.exports = {
'no-with': 'error',
'prefer-promise-reject-errors': 'error',
'radix': 'error',
'wrap-iife': 'error',
'yoda': ['error', 'never'],
// Strict Mode
'strict': 'error',
Expand All @@ -62,68 +52,28 @@ module.exports = {
'handle-callback-err': 'error',
'no-path-concat': 'error',
// Stylistic Issues
'array-bracket-spacing': ['error', 'never'],
'block-spacing': ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'comma-dangle': ['error', 'never'],
'comma-spacing': ['error', {
before: false,
after: true
}],
'comma-style': ['error', 'last'],
'computed-property-spacing': ['error', 'never'],
'eol-last': 'error',
'func-call-spacing': 'error',
'indent': ['error', 2, { SwitchCase: 1 }],
'key-spacing': ['error', {
beforeColon: false,
afterColon: true
}],
'keyword-spacing': 'error',
'linebreak-style': ['error', 'unix'],
'lines-around-comment': ['error', { beforeBlockComment: true }],
'new-cap': 'error',
'new-parens': 'error',
'no-array-constructor': 'error',
'no-mixed-operators': 'error',
'no-multiple-empty-lines': 'error',
'no-nested-ternary': 'error',
'no-new-object': 'error',
'no-trailing-spaces': 'error',
'no-unneeded-ternary': 'error',
'no-whitespace-before-property': 'error',
'one-var': ['error', {
uninitialized: 'always',
initialized: 'never'
}],
'operator-linebreak': ['error', 'before'],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'semi-spacing': ['error', {
before: false,
after: true
}],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', 'never'],
'space-in-parens': ['error', 'never'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', {
words: false,
nonwords: false
}],
'spaced-comment': ['error', 'always'],
'template-tag-spacing': ['error', 'never'],
'unicode-bom': ['error', 'never'],
// ECMAScript 6
'arrow-spacing': 'error',
'generator-star-spacing': ['error', 'after'],
'no-confusing-arrow': ['error', { allowParens: true }],
'no-duplicate-imports': 'error',
'no-useless-computed-key': 'error',
'no-useless-constructor': 'error',
'no-useless-rename': 'error',
'rest-spread-spacing': ['error', 'never'],
'template-curly-spacing': ['error', 'never'],
'yield-star-spacing': ['error', 'after']
'prettier/prettier': ['error', {
semi: true,
singleQuote: true,
tabWidth: 2,
useTabs: false
}]
}
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"eslint": ">=5.0.0"
},
"dependencies": {
"eslint-plugin-node": "^7.0.0"
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-node": "^7.0.0",
"eslint-plugin-prettier": "^2.6.2"
}
}
93 changes: 93 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


balanced-match@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"

brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
dependencies:
balanced-match "^1.0.0"
concat-map "0.0.1"

concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"

eslint-config-prettier@^2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3"
dependencies:
get-stdin "^5.0.1"

eslint-plugin-es@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz#5acb2565db4434803d1d46a9b4cbc94b345bd028"
dependencies:
eslint-utils "^1.3.0"
regexpp "^2.0.0"

eslint-plugin-node@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz#a6e054e50199b2edd85518b89b4e7b323c9f36db"
dependencies:
eslint-plugin-es "^1.3.1"
eslint-utils "^1.3.1"
ignore "^4.0.2"
minimatch "^3.0.4"
resolve "^1.8.1"
semver "^5.5.0"

eslint-plugin-prettier@^2.6.2:
version "2.6.2"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.2.tgz#71998c60aedfa2141f7bfcbf9d1c459bf98b4fad"
dependencies:
fast-diff "^1.1.1"
jest-docblock "^21.0.0"

eslint-utils@^1.3.0, eslint-utils@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512"

fast-diff@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154"

get-stdin@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"

ignore@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.2.tgz#0a8dd228947ec78c2d7f736b1642a9f7317c1905"

jest-docblock@^21.0.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"

minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.1.7"

path-parse@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"

regexpp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365"

resolve@^1.8.1:
version "1.8.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26"
dependencies:
path-parse "^1.0.5"

semver@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"