Skip to content

Commit

Permalink
Merge pull request #34 from relaxxpls/master
Browse files Browse the repository at this point in the history
[v1.3.1] Add settings, footer and update deps
  • Loading branch information
relaxxpls authored Dec 9, 2021
2 parents 4df317a + 8c21db1 commit 6a46db5
Show file tree
Hide file tree
Showing 128 changed files with 3,357 additions and 3,891 deletions.
104 changes: 43 additions & 61 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const warnInDevelopment =
process.env.NODE_ENV === 'production' ? 'error' : 'warn'
const isDev = process.env.NODE_ENV === 'development'
const warnInDevelopment = isDev ? 'warn' : 'error'

module.exports = {
env: {
Expand All @@ -8,8 +8,6 @@ module.exports = {
},

extends: [
'plugin:react-hooks/recommended',
'plugin:react/recommended',
'react-app',
'react-app/jest',
'plugin:promise/recommended',
Expand All @@ -27,25 +25,45 @@ module.exports = {
sourceType: 'module',
},

plugins: [
'react',
'prettier',
'import',
'jsx-a11y',
'react-hooks',
'promise',
],
plugins: ['prettier', 'promise'],

rules: {
// Allow debugger and console statement in development
'no-debugger': warnInDevelopment,
'no-console': warnInDevelopment,

// Enable i++ in for loops
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'arrow-body-style': ['off'],
'comma-dangle': 'off',

// ? git handles this instead
'linebreak-style': 'off',
// ? allow debugger and console statement in development
'no-console': warnInDevelopment,
'no-debugger': warnInDevelopment,
// ? for use with redux-toolkit (immer)
'no-param-reassign': [
'error',
{
ignorePropertyModificationsFor: ['state'],
props: true,
},
],
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'styled-components',
message: "Please import from 'styled-components/macro.'",
},
],
patterns: ['!styled-components/macro'],
},
],
'no-unused-expressions': 'warn',
'no-unused-vars': [
warnInDevelopment,
{
args: 'none',
vars: 'all',
},
],
semi: 'off',
'import/extensions': [
warnInDevelopment,
'always',
Expand All @@ -54,7 +72,6 @@ module.exports = {
jsx: 'never',
},
],

'import/no-extraneous-dependencies': [
'off',
{
Expand All @@ -63,7 +80,6 @@ module.exports = {
peerDependencies: true,
},
],

'import/order': [
'error',
{
Expand All @@ -85,54 +101,20 @@ module.exports = {
warnOnUnassignedImports: true,
},
],

// Git handles this instead
'linebreak-style': 'off',

// For use with redux-toolkit (immer)
'no-param-reassign': [
'error',
{
ignorePropertyModificationsFor: ['state'],
props: true,
},
],

'no-restricted-imports': [
'react/function-component-definition': [
'error',
{
paths: [
{
name: 'styled-components',
message: "Please import from 'styled-components/macro.'",
},
],
patterns: ['!styled-components/macro'],
},
],

'no-unused-expressions': 'warn',
'no-unused-vars': [
warnInDevelopment,
{
args: 'none',
vars: 'all',
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/jsx-props-no-spreading': 'off',

// Shift to TypeScript for this
// ? shift to TypeScript for this
'react/prop-types': 'off',

// React 17 doesn't need this
// ? react 17 doesn't need this
'react/react-in-jsx-scope': 'off',

// Checks rules of Hooks
'react-hooks/rules-of-hooks': 'error',
// Checks effect dependencies
// ? checks effect dependencies
'react-hooks/exhaustive-deps': 'warn',

semi: 'off',
},

settings: {
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Personal Template
**/.mock/
*.temp
*.old
.env
.env.md

# Local Netlify folder
.netlify
Expand All @@ -26,6 +23,8 @@
# misc
.DS_Store
.env
.env.development
.env.production
.env.local
.env.development.local
.env.test.local
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.2.0
16.13.1
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules
build
public
Loading

0 comments on commit 6a46db5

Please sign in to comment.