Skip to content

Commit b5aedd7

Browse files
committed
chore: update eslint configuration
1 parent daafe79 commit b5aedd7

File tree

4 files changed

+83
-3
lines changed

4 files changed

+83
-3
lines changed

.eslintrc

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
11
{
2-
"extends": "google",
2+
"extends": [
3+
"eslint:recommended",
4+
"google"
5+
],
36
"parserOptions": {
4-
"ecmaVersion": 6,
7+
"ecmaVersion": 6
58
},
69
"env": {
10+
"es6": true,
711
"node": true
812
},
913
"rules": {
10-
"max-len": [2, 140, 2]
14+
"max-len": [2, 140, 2],
15+
"no-console": [2, {
16+
"allow": ["warn", "error"]
17+
}],
18+
"valid-jsdoc": [2, {
19+
"requireReturn": true,
20+
"requireParamDescription": true,
21+
"requireReturnDescription": true,
22+
"prefer": {
23+
"return": "return",
24+
"arg": "param",
25+
"argument": "param"
26+
},
27+
"preferType": {
28+
"object": "object"
29+
}
30+
}]
1131
}
1232
}

scripts/log/index.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2014-2018 Mickael Jeanroy
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
'use strict';
26+
27+
const log = require('fancy-log');
28+
const colors = require('ansi-colors');
29+
30+
/**
31+
* Log message to output using `DEBUG` level.
32+
*
33+
* @param {string} msg Message to log.
34+
* @return {void}
35+
*/
36+
function debug(msg) {
37+
log(colors.grey(msg));
38+
}
39+
40+
/**
41+
* Log message to output using `ERROR` level.
42+
*
43+
* @param {string} msg Message to log.
44+
* @return {void}
45+
*/
46+
function error(msg) {
47+
log(colors.red(msg));
48+
}
49+
50+
module.exports = {
51+
debug,
52+
error,
53+
};

scripts/release/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const gulp = require('gulp');
2727
const config = require('../config');
2828
const git = require('gulp-git');
2929
const bump = require('gulp-bump');
30+
const log = require('../log');
3031

3132
/**
3233
* Update version in number in `package.json` file.

test/.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"env": {
3+
"jasmine": true
4+
}
5+
}
6+

0 commit comments

Comments
 (0)