Skip to content

Commit a842ebc

Browse files
committed
add linter
1 parent a8242df commit a842ebc

File tree

6 files changed

+3668
-146
lines changed

6 files changed

+3668
-146
lines changed

.babelrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "presets": ["@babel/preset-env"] }

.eslintrc.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"jest": true
6+
},
7+
"parser": "babel-eslint",
8+
"parserOptions": {
9+
"ecmaVersion": 2018,
10+
"sourceType": "module"
11+
},
12+
"extends": ["airbnb-base"],
13+
"rules": {
14+
"no-shadow": "off",
15+
"no-param-reassign": "off",
16+
"eol-last": "off",
17+
"arrow-parens": "off"
18+
},
19+
"ignorePatterns": [
20+
"dist/",
21+
"build/"
22+
]
23+
}

.github/workflows/linters.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Linters
2+
3+
on: pull_request
4+
5+
env:
6+
FORCE_COLOR: 1
7+
8+
jobs:
9+
eslint:
10+
name: ESLint
11+
runs-on: ubuntu-18.04
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: "12.x"
17+
- name: Setup ESLint
18+
run: |
19+
npm install --save-dev eslint@6.8.x eslint-config-airbnb-base@14.1.x eslint-plugin-import@2.20.x babel-eslint@10.1.x
20+
[ -f .eslintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/javascript/.eslintrc.json
21+
- name: ESLint Report
22+
run: npx eslint .
23+
stylelint:
24+
name: Stylelint
25+
runs-on: ubuntu-18.04
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-node@v1
29+
with:
30+
node-version: "12.x"
31+
- name: Setup Stylelint
32+
run: |
33+
npm install --save-dev stylelint@13.3.x stylelint-scss@3.17.x stylelint-config-standard@20.0.x stylelint-csstree-validator
34+
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/javascript/.stylelintrc.json
35+
- name: Stylelint Report
36+
run: npx stylelint "**/*.{css,scss}"

.stylelintrc.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": ["stylelint-config-standard"],
3+
"plugins": ["stylelint-scss", "stylelint-csstree-validator"],
4+
"rules": {
5+
"at-rule-no-unknown": null,
6+
"scss/at-rule-no-unknown": true,
7+
"csstree/validator": true
8+
},
9+
"ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css"]
10+
}

0 commit comments

Comments
 (0)