Shared ESLint configs for Node, Web, and universal Expo projects.
yarn add --dev eslint-config-universe eslint prettier @typescript-eslint/eslint-plugin @typescript-eslint/parser
Import this config into your own ESLint configuration using the extends
option. ESLint checks both package.json and .eslintrc.* files for its configuration:
{
"eslintConfig": {
"extends": "universe/native"
}
}
// Choose from universe/native, universe/node, universe/web
module.exports = {
extends: 'universe/native',
};
If you would like to customize the Prettier settings, create a file named .prettierrc
in your project directory. An example of Prettier configuration file:
{
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"bracketSameLine": true,
"trailingComma": "es5"
}
Read more about configuring prettier
and all of the available options.
There are several configs for different platforms. They are:
universe
: the basic config for JavaScript projects for which there isn't a more specific configuniverse/native
: the config for React Native projects, including Expo projects, with support for React and JSXuniverse/web
: the config for code that runs in web browsers, with support for React and JSXuniverse/node
: the config for code that runs in Node