Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit e31a1f2

Browse files
Add ESLint
1 parent c1be480 commit e31a1f2

File tree

5 files changed

+985
-1
lines changed

5 files changed

+985
-1
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# include as a lint target.
2+
!.eslintrc.js

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*eslint-env commonjs*/
2+
/*eslint quote-props: [2, "always"] */
3+
4+
'use strict';
5+
6+
// ESLint Configuration Files enables to include comments.
7+
// http://eslint.org/docs/configuring/#comments-in-configuration-files
8+
module.exports = {
9+
'extends': [
10+
'./node_modules/eslint-config-fluct/config/eslintrc_core.js',
11+
],
12+
13+
'parserOptions': {
14+
'ecmaVersion': 2018,
15+
},
16+
17+
'env': {
18+
'es6': true,
19+
},
20+
21+
'root': true,
22+
23+
'rules': {
24+
'no-magic-numbers': 'off',
25+
}
26+
};

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
NPM_MOD_DIR := $(CURDIR)/node_modules
2+
NPM_BIN := $(NPM_MOD_DIR)/.bin
3+
4+
all: help
5+
6+
help:
7+
@echo "Specify the task"
8+
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
9+
@exit 1
10+
11+
# Test
12+
test: lint ## Run tests & lints for all.
13+
14+
lint: eslint
15+
16+
.PHONY: eslint
17+
eslint:
18+
$(NPM_BIN)/eslint --ext=js,jsx,mjs $(CURDIR)

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
"test": "echo \"Error: no test specified\" && exit 1"
77
},
88
"author": "",
9-
"license": "MIT"
9+
"license": "MIT",
10+
"devDependencies": {
11+
"eslint": "^5.12.0",
12+
"eslint-config-fluct": "https://github.com/voyagegroup/eslint-config-fluct/archive/d62dacdcfcdb68b9d0416fb75abca516a4d938d7.tar.gz"
13+
}
1014
}

0 commit comments

Comments
 (0)