1.1.0 • Published 2 years ago
@dotin-tech/eslint-config-react-native v1.1.0
Eslint and Prettier config for React Native
Installing
# npm
npx install-peerdeps --dev @dotin-tech/eslint-config-react-native
# yarn
npx install-peerdeps --dev @dotin-tech/eslint-config-react-native -Y
.eslintrc
:
{
"extends": ["@dotin-tech/react-native"],
"settings": {
"import/resolver": {
"babel-module": {}
}
}
}
.prettierrc
:
{
"singleQuote": true,
"printWidth": 80
}
babel.config.js
:
module.exports = {
plugins: [
[
'module-resolver',
{
root: ['./'],
alias: {
'^#/(.+)': './src/\\1',
},
extensions: ['.js', '.jsx', '.json'],
},
],
],
};
jsconfig.json
:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"#/*": ["src/*"]
}
},
"exclude": ["node_modules"]
}
package.json
:
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
Settings
.eslintrc
:
{
"extends": [
"@dotin-tech/react-native"
],
"rules": {
"no-console": 2,
"prettier/prettier": [
"error",
{
"singleQuote": true,
"printWidth": 100,
}
]
}
}