Last active
April 10, 2022 05:16
-
-
Save ozluy/f275df3d5f9eb0897a46e53d8d1ada8f to your computer and use it in GitHub Desktop.
Nextjs Eslint
This file contains hidden or 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
//.eslintrc | |
{ | |
"env": { | |
"browser": true, | |
"es6": true, | |
"commonjs": true | |
}, | |
"plugins": ["react"], | |
"extends": [ | |
"eslint:recommended", | |
"plugin:react/recommended" | |
], | |
"settings": { | |
"import/resolver": { | |
"node": { | |
"paths": ["./"] | |
} | |
} | |
}, | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaVersion": 6, | |
"sourceType": "module", | |
"ecmaFeatures": { | |
"jsx": true, | |
"experimentalObjectRestSpread": true, | |
"modules": true | |
} | |
}, | |
"rules": { | |
"react/prefer-stateless-function": 0, | |
"linebreak-style": 0, | |
"jsx-a11y/heading-has-content": 0, | |
"jsx-a11y/href-no-hash": 0, | |
"jsx-a11y/anchor-is-valid": 0, | |
"no-underscore-dangle": 0, | |
"react/no-find-dom-node": 0, | |
"react/prop-types": 0, | |
"no-nested-ternary": 0 | |
} | |
} |
This file contains hidden or 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
// next.config.js | |
/* eslint-disable */ | |
const path = require('path') | |
module.exports = ({ | |
exportPathMap: async function(defaultPathMap) { | |
return { | |
'/': { page: '/' }, | |
'/about-us': { page: '/about-us' }, | |
'/contact-us': { page: '/contact-us' }, | |
} | |
}, | |
webpack(config, { dev }) { | |
if (dev) { | |
config.module.rules.push({ | |
test: /\.js$/, | |
loader: 'eslint-loader', | |
exclude: ['/node_modules/', '/.next/', '/out/'], | |
enforce: 'pre', | |
options: { | |
emitWarning: true, | |
}, | |
}) | |
} | |
return config | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment