module.exports = {
globals: {
module: true,
},
env: {
browser: true,
es6: true,
jest: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
],
plugins: ["react", "@typescript-eslint"],
settings: {
react: {
pragma: "React",
version: "detect",
},
},
rules: {
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"react/react-in-jsx-scope": 0,
},
'import/order': [
2,
{
'newlines-between': 'always',
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'unknown',
'object',
'type',
],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
pathGroups: [
{
pattern: 'react*',
group: 'external',
position: 'before',
},
],
},
],
};
// Add lint script to package.json
// "lint": "eslint './src/**/*.{ts,tsx}'"
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter