Comment/Like #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linters | |
on: pull_request | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
eslint: | |
name: ESLint | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Setup Client ESLint | |
working-directory: ./client | |
run: | | |
npm install --save-dev [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] @babel/[email protected] @babel/[email protected] @babel/[email protected] @babel/[email protected] @babel/[email protected] | |
[ -f .eslintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.eslintrc.json | |
[ -f .babelrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.babelrc | |
- name: Client ESLint Report | |
working-directory: ./client | |
run: npx eslint "**/*.{js,jsx}" | |
- name: Setup Server ESLint | |
working-directory: ./server | |
run: | | |
npm install --save-dev @eslint/[email protected] @babel/[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] | |
[ -f eslint.config.js ] | |
[ -f .babelrc ] | |
- name: Server ESLint Report | |
working-directory: ./server | |
run: npx eslint "**/*.{js,jsx}" | |
stylelint: | |
name: Stylelint | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Setup Client Stylelint | |
working-directory: ./client | |
run: | | |
npm install --save-dev [email protected] [email protected] [email protected] [email protected] | |
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.stylelintrc.json | |
- name: Client Stylelint Report | |
working-directory: ./client | |
run: npx stylelint "**/*.{css,scss}" | |
nodechecker: | |
name: node_modules checker | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check node_modules existence | |
working-directory: ./client | |
run: | | |
if [ -d "node_modules/" ]; then echo -e "\e[1;31mThe node_modules/ folder was pushed to the repo. Please remove it from the GitHub repository and try again."; echo -e "\e[1;32mYou can set up a .gitignore file with this folder included on it to prevent this from happening in the future." && exit 1; fi |