Skip to content

Commit

Permalink
Merge pull request #1 from ITurres/project-setup
Browse files Browse the repository at this point in the history
Project setup
  • Loading branch information
ITurres authored Sep 4, 2023
2 parents c233b68 + c9f4d24 commit 9639a5c
Show file tree
Hide file tree
Showing 19 changed files with 22,386 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-transform-react-jsx" // ?For JSX/TSX syntax support
]
}
36 changes: 36 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"extends": [
"airbnb",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"plugins": ["react"],
"rules": {
"react/jsx-filename-extension": ["error", { "extensions": [".jsx", ".tsx"] }],
"react/react-in-jsx-scope": "off",
"import/no-unresolved": "off",
"no-shadow": "off"
},
"overrides": [
{
// ?feel free to replace with your preferred file pattern - eg. 'src/**/*Slice.js' or 'redux/**/*Slice.js'
"files": ["src/**/*Slice.js"],
// !avoid state param assignment
"rules": { "no-param-reassign": ["error", { "props": false }] }
}
],
"ignorePatterns": ["dist/", "build/"]
}
54 changes: 54 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Linters

on:
push:

env:
FORCE_COLOR: 1

jobs:
eslint:
name: ESLint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18.x"
- name: Setup ESLint
run: |
npm install --save-dev eslint@7 eslint-config-airbnb@18 eslint-plugin-import@2 eslint-plugin-jsx-a11y@6 eslint-plugin-react@7 eslint-plugin-react-hooks@4 @babel/eslint-parser@7 @babel/core@7 @babel/plugin-syntax-jsx@7 @babel/preset-env@7 @babel/preset-react@7
[ -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: ESLint Report
run: npx eslint "**/*.{ts,tsx}"

stylelint:
name: Stylelint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18.x"
- name: Setup Stylelint
run: |
npm install --save-dev stylelint@13 stylelint-scss@3 stylelint-config-standard@21 stylelint-csstree-validator@1
[ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/react-redux/.stylelintrc.json
- name: Stylelint Report
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
run: |
if [ -d "node_modules/" ] || [ -f "yarn.lock" ]; then
echo -e "\e[1;31mThe node_modules/ folder or yarn.lock file was pushed to the repo. Please remove them from the GitHub repository and try again."
echo -e "\e[1;32mYou can set up a .gitignore file with these files included to prevent this from happening in the future."
exit 1
fi
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# dependencies
/node_modules

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
39 changes: 39 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"extends": ["stylelint-config-standard"],
"plugins": ["stylelint-scss", "stylelint-csstree-validator"],
"rules": {
"at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"tailwind",
"apply",
"variants",
"responsive",
"screen"
]
}
],
"scss/at-rule-no-unknown": [
true,
{
"ignoreAtRules": [
"tailwind",
"apply",
"variants",
"responsive",
"screen"
]
}
],
"csstree/validator": true
},
"ignoreFiles": [
"build/**",
"dist/**",
"**/reset*.css",
"**/bootstrap*.css",
"**/*.js",
"**/*.jsx"
]
}
Loading

0 comments on commit 9639a5c

Please sign in to comment.