Skip to content

Commit

Permalink
Merge pull request #4 from cgalvarez/dev
Browse files Browse the repository at this point in the history
Improve CI, docs, coverage, publishing, quality
  • Loading branch information
Carlos García authored Feb 27, 2018
2 parents ddc4d0e + 7c09501 commit e7d7428
Show file tree
Hide file tree
Showing 30 changed files with 1,316 additions and 433 deletions.
2 changes: 1 addition & 1 deletion .bithoundrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ignore": [
"**/node_modules/**",
".reports/**"
"coverage/**"
],
"test": [
"test/**"
Expand Down
46 changes: 46 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# CodeClimate config file configuration: https://docs.codeclimate.com/docs/advanced-configuration
version: "2"
plugins:
duplication:
enabled: true
# ESLint: https://docs.codeclimate.com/docs/eslint
eslint:
enabled: true
channel: "eslint-4"
checks:
complexity:
enabled: true
config:
config: .eslintrc.cc.yaml
extensions:
- .es6
- .js
fixme:
enabled: true
# How to configure: https://docs.codeclimate.com/docs/git-legal
git-legal:
enabled: false
markdownlint:
enabled: true
exclude_fingerprints:
# Unavoidable lengthy lines.
- 184efb4b1212345dcbe0bf36064230f4
- c03f7976bb3e27eb1e08b08d0475a15b
# Trailing question mark in heading.
- 299b8b7c47d3644f029ad29866c9e5b0
# Requires a `shrinkwrap.json` at the project root to work!
# So we'll rely on the cloud check by NodeSecurity.io.
nodesecurity:
enabled: false
structure:
enabled: true
exclude_patterns:
- ".git/**/*"
- ".nyc_output/**/*"
- ".reports/**/*"
- "coverage/**/*"
- "node_modules/**/*"
# `eslint` when exec by CodeClimate doesn't use the specific config
# file at `test/.eslintrc.yaml`, that's why we exclude it here.
- "test/**/*"
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Unignore hidden files/folders (need to be explicitly passed as args).
# See https://github.com/eslint/eslint/pull/6844#issuecomment-239597082
!.*

# Skip these ones.
.git/**/*
.reports/**/*
coverage/**/*
node_modules/**/*
test/fake/**/*
55 changes: 55 additions & 0 deletions .eslintrc.cc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
root: true
plugins:
- lodash
- mocha
- node
- security
extends:
- airbnb-base
- plugin:lodash/canonical
env:
node: true
browser: true
shared-node-browser: true
rules:
global-require: off
# Rules of plugin `lodash` ~> disable most of lodash preference over native rules.
lodash/prefer-constant: error
lodash/prefer-get: off
lodash/prefer-includes: off
lodash/prefer-is-nil: error
lodash/prefer-lodash-chain: off
lodash/prefer-lodash-method: off
lodash/prefer-lodash-typecheck: error
lodash/prefer-matches: off
lodash/prefer-noop: error
lodash/prefer-over-quantifier: off
lodash/prefer-some: off
lodash/prefer-startswith: off
lodash/prefer-times: off
overrides:
- files:
- test/**/*.js
rules:
no-unused-expressions: off
# Rules of plugin `node` ~> no test file is meant to be published!
node/no-unpublished-require: off
# Rules of plugin `mocha`
mocha/handle-done-callback: error
mocha/max-top-level-suites: error
mocha/no-exclusive-tests: error
mocha/no-global-tests: error
mocha/no-hooks: off
mocha/no-hooks-for-single-case: error
mocha/no-identical-title: error
mocha/no-mocha-arrows: off
mocha/no-nested-tests: error
mocha/no-pending-tests: error
mocha/no-return-and-callback: error
mocha/no-sibling-hooks: error
mocha/no-skipped-tests: error
mocha/no-synchronous-tests: off
mocha/no-top-level-hooks: error
mocha/valid-suite-description: error
mocha/valid-test-description: error
83 changes: 82 additions & 1 deletion .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,89 @@
---
extends: airbnb-base
root: true
plugins:
- filenames
- json
- lodash
- node
- security
- smells
- you-dont-need-lodash-underscore
extends:
- airbnb-base
- plugin:lodash/canonical
- plugin:node/recommended
- plugin:security/recommended
- plugin:you-dont-need-lodash-underscore/compatible
env:
node: true
browser: true
shared-node-browser: true
rules:
global-require: off
# Rules of plugin `filenames`.
filenames/match-regex: error
filenames/match-exported:
- error
- kebab
filenames/no-index: off
# Rules of plugin `lodash` ~> disable most of lodash preference over native rules.
lodash/prefer-constant: error
lodash/prefer-get: off
lodash/prefer-includes: off
lodash/prefer-is-nil: error
lodash/prefer-lodash-chain: off
lodash/prefer-lodash-method: off
lodash/prefer-lodash-typecheck: error
lodash/prefer-matches: off
lodash/prefer-noop: error
lodash/prefer-over-quantifier: off
lodash/prefer-some: off
lodash/prefer-startswith: off
lodash/prefer-times: off
# Rules of plugin `security`.
# See https://github.com/nodesecurity/eslint-plugin-security for rules description.
# Rules of plugin `smells`.
smells/no-switch: off
smells/no-complex-switch-case: error
smells/no-setinterval: error
smells/no-this-assign: error
smells/no-complex-string-concat: error
smells/no-complex-chaining: error
# https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns
overrides:
- files:
- lib/manager.js
- test/helpers/fix.js
rules:
# Rules of plugin `smells` ~> Joi is meant to be chained!
smells/no-complex-chaining: off
- files:
- test/**/*.spec.js
rules:
# Rules of plugin `smells` ~> mocha is meant to be chained!
smells/no-complex-chaining: off
- files:
- test/**/*.js
rules:
# Rules of plugin `node` ~> no test file is meant to be published!
node/no-unpublished-require: off
# Rules of plugin `security`
security/detect-unsafe-regex: off
security/detect-buffer-noassert: off
security/detect-child-process: off
security/detect-disable-mustache-escape: off
security/detect-eval-with-expression: off
security/detect-no-csrf-before-method-override: off
security/detect-non-literal-fs-filename: off
security/detect-non-literal-regexp: off
security/detect-non-literal-require: off
security/detect-object-injection: off
securiyt/detect-possible-timing-attacks: off
security/detect-pseudoRandomBytes: off
- files:
- bin/*.js
- test/**/*.spec.js
rules:
# Rules of plugin `filenames` ~> tests/binaries export nothing!
filenames/match-regex: 0
filenames/match-exported: off
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# Hidden folders.
.nyc_output/
.reports/

# Folders.
coverage/
node_modules/

# Hidden files.
.inch.config.json

# Files.
docs.json
npm-debug.log
4 changes: 4 additions & 0 deletions .inch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
files:
included:
- lib/**/*.js
11 changes: 11 additions & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Tutorial:
# - https://github.com/markdownlint/markdownlint/blob/master/docs/configuration.md
# - https://updownpress.github.io/markdown-lint
# Rules: https://github.com/markdownlint/markdownlint/blob/v0.4.0/docs/RULES.md
# Examples:
# - https://github.com/Chalarangelo/30-seconds-of-code/blob/master/.mdlrc
# - https://github.com/coel-lang/coel/blob/master/.mdlrc
# - https://github.com/elerch/vcsh_mdlrc/blob/master/.mdl.rb
rules "~MD002", # First header should be a top level header ~> Using HTML
"~MD041" # First line in file should be a top level header
style ".mdlrc.style.rb"
4 changes: 4 additions & 0 deletions .mdlrc.style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
all
rule 'MD013', :line_length => "100"

exclude_rule 'no-inline-html' # MD033
30 changes: 30 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Hidden folders.
.git
.nyc_output
.reports

# Folders.
coverage
node_modules
test

# Hidden files.
.bithoundrc
.codeclimate.yml
.commitlintrc.yaml
.editorconfig
.eslintignore
.eslintrc.cc.yaml
.eslintrc.yaml
.gitignore
.inch.config.json
.inch.yml
.mdlrc
.mdlrc.style.rb
.nycrc.json
.travis.yml

# Files.
docs.json
npm-debug.log
yarn.lock
4 changes: 2 additions & 2 deletions .nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"lib/"
],
"reporter": ["lcov", "text"],
"report-dir": ".reports",
"temp-directory": ".reports/.nyc_output",
"report-dir": "coverage",
"temp-directory": "coverage/.nyc_output",
"per-file": true,
"branches": 80,
"functions": 80,
Expand Down
Loading

0 comments on commit e7d7428

Please sign in to comment.