Skip to content

refactoring test files test#276

Merged
thedaviddias merged 4 commits intohtmlhint:developfrom
Shinigami92:refactoring/test/upgrade-to-es2016
Sep 3, 2018
Merged

refactoring test files test#276
thedaviddias merged 4 commits intohtmlhint:developfrom
Shinigami92:refactoring/test/upgrade-to-es2016

Conversation

@Shinigami92
Copy link
Contributor

  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Short description of what this resolves:

better readable code
up to date ES2015+ code

id-class-value.spec.js not touched because pending PR #238
spec-char-escape.spec.js not touched because pending PR #144
therefore, no merge conflict is introduced here

no programming logic was touched

Proposed changes:

  • added "esversion": 6 to .jshintrc-node
  • refactored var to let to const
  • prefer template
  • use arrow callbacks (if useful, not for mocha describe and it)

used eslint config

{
    "env": {
        "browser": true,
        "commonjs": true,
        "es6": true,
        "node": true
    },
    "extends": "eslint:recommended",
    "parserOptions": {
        "ecmaVersion": 2016,
        "sourceType": "module"
    },
    "rules": {
        "arrow-parens": ["warn", "always"],
        "indent": ["error", 4],
        "linebreak-style": ["error", "unix"],
        "quotes": ["error", "single", { "avoidEscape": true }],
        "no-control-regex": "off",
        "no-empty": ["error", { "allowEmptyCatch": true }],
        "no-var": "error",
        "one-var": ["warn", "never"],
        "prefer-const": ["warn"],
        "prefer-template": ["warn"],
        "semi": ["error", "always"]
    },
    "globals": {
        "HTMLHint": true,
        "JSHINT": true,
        "CSSLint": true
    }
}

extra eslint in test folder

{
    "env": {
        "mocha": true
    }
}

used prettier config

{
    "arrowParens": "always",
    "printWidth": 100,
    "singleQuote": true
}

@codecov-io
Copy link

codecov-io commented Aug 27, 2018

Codecov Report

Merging #276 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           develop   #276   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files            1      1           
  Lines            1      1           
======================================
  Hits             1      1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 00951e7...ca47f1c. Read the comment docs.

@thedaviddias thedaviddias added enhancement Functionality that enhances existing features triage An HTMLHint team member will look at this issue labels Aug 27, 2018
@thedaviddias thedaviddias added #status: accepted 👍 and removed triage An HTMLHint team member will look at this issue labels Sep 3, 2018
@thedaviddias thedaviddias merged commit e3b34e0 into htmlhint:develop Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Functionality that enhances existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants