Package aims to quickly setup your eslint and prettier configs based on Codemask guidelines.
Pkg version | Eslint version |
---|---|
2.x | > 9.0 |
1.x | < 9.0 |
It simply extends ESLint and Prettier with rules used at Codemask. Check the eslint.config.mjs
file to see what is included. If you are using prettier you can copy config file as well.
- Add
eslint
andeslint-config-codemask
to your project:
yarn add --dev eslint eslint-config-codemask
- Create (or update) a
eslint.config.mjs
file with the following content:
import { codemaskConfig, codemaskImportConfig, codemaskStylisticConfig } from 'eslint-config-codemask'
export default [
...codemaskConfig,
...codemaskImportConfig,
...codemaskStylisticConfig
]
General code standard rules
Import order rules
Stylistic rules
Skip if are using any formatter (prettier, dprint, etc.)
- Add
eslint-plguin-react-native
to your project
yarn add eslint-plugin-react-native --dev
- Include
react-native
plugin, andreact-native
rules:
import reactNative from 'eslint-plugin-react-native'
import { fixupPluginRules } from '@eslint/compat'
export default [
...codemaskConfig,
{
plugins: {
'react-native': fixupPluginRules(reactNative),
},
rules: {
'react-native/no-raw-text': [
'error',
{
skip: ['Typography'],
},
],
'react-native/no-inline-styles': 'warn',
},
},
]