Skip to content

Commit 7cc8d77

Browse files
committed
Add linters config files in my working directory
1 parent c2e2b34 commit 7cc8d77

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

Diff for: .babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"@babel/preset-react"
4+
],
5+
"plugins": ["@babel/plugin-syntax-jsx"]
6+
}

Diff for: .eslintrc.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"jest": true
6+
},
7+
"parser": "@babel/eslint-parser",
8+
"parserOptions": {
9+
"ecmaFeatures": {
10+
"jsx": true
11+
},
12+
"ecmaVersion": 2018,
13+
"sourceType": "module"
14+
},
15+
"extends": ["airbnb", "plugin:react/recommended"],
16+
"plugins": ["react"],
17+
"rules": {
18+
"react/jsx-filename-extension": ["warn", { "extensions": [".js", ".jsx"] }],
19+
"react/react-in-jsx-scope": "off",
20+
"import/no-unresolved": "off",
21+
"no-shadow": "off"
22+
},
23+
"ignorePatterns": [
24+
"dist/",
25+
"build/"
26+
]
27+
}

Diff for: .github/workflows/linters.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
20+
[ -f .eslintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.eslintrc.json
21+
[ -f .babelrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.babelrc
22+
- name: ESLint Report
23+
run: npx eslint .
24+
stylelint:
25+
name: Stylelint
26+
runs-on: ubuntu-18.04
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: actions/setup-node@v1
30+
with:
31+
node-version: "12.x"
32+
- name: Setup Stylelint
33+
run: |
34+
35+
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.stylelintrc.json
36+
- name: Stylelint Report
37+
run: npx stylelint "**/*.{css,scss}"

Diff for: .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", "**/*.js", "**/*.jsx"]
10+
}

0 commit comments

Comments
 (0)