Skip to content

Instantly share code, notes, and snippets.

@rikkrome
Last active August 6, 2021 23:07
Show Gist options
  • Save rikkrome/e00ce71026086d4aa2a3baf81d5ccad6 to your computer and use it in GitHub Desktop.
Save rikkrome/e00ce71026086d4aa2a3baf81d5ccad6 to your computer and use it in GitHub Desktop.
Configs
module.exports = {
env: {
es2020: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: 'module',
},
settings: {
'react': {
version: '17',
},
'import/extensions': ['.js', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx'],
},
},
},
ignorePatterns: ['**/lib/**'],
extends: [
'eslint-config-prettier',
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-native-a11y/all',
],
plugins: [
'babel',
'eslint-comments',
'import',
'prettier',
'react',
'react-hooks',
'react-native',
'react-native-a11y',
'@typescript-eslint/eslint-plugin',
],
rules: {
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'linebreak-style': ['error', 'unix'],
'prettier/prettier': [
'error',
{
quoteProps: 'consistent',
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
bracketSpacing: false,
jsxBracketSameLine: true,
arrowParens: 'always',
},
],
},
};
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn lint && yarn typescript && yarn test
"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/eslint-parser": "^7.14.4",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"babel-jest": "^27.0.2",
"eslint": "^7.14.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-babel": "^5.3.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.11.0",
"eslint-plugin-react-native-a11y": "^2.0.4",
"husky": "^6.0.0",
"jest": "^27.0.4",
"metro-react-native-babel-preset": "^0.66.0",
"prettier": "^2.3.0",
"typescript": "^4.3.2"
},
"scripts": {
"prepare": "husky install",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"typescript": "tsc --noEmit --composite false",
"test": "jest"
},
{
"compilerOptions": {
"composite": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"importsNotUsedAsValues": "error",
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noStrictGenericChecks": false,
"noUnusedLocals": true,
"noUnusedParameters": true,
"target": "esnext",
"module": "esnext",
"lib": [
"esnext",
"dom"
],
"allowJs": true,
"jsx": "react-native",
"isolatedModules": true,
"strict": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"baseUrl": ".",
"paths": {
"@app/*": [
"./app/src"
],
"@core/*": ["./core/packages/*/src"]
},
"outDir": "dist",
"rootDirs": ["."],
"removeComments": true
},
"exclude": [
"lib",
"dist",
"ios",
"node_modules",
"babel.config.js",
"**/babel.config.js",
"metro.config.js",
"jest.config.js",
"**/__tests__",
"**/__mocks__",
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment