eslint-config-universe
Shared ESLint configs for universal Expo projects, Node, and web
Last updated 2 years ago by tsapeta .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install eslint-config-universe 
SYNC missed versions from official npm registry.

eslint-config-universe

Shared ESLint configs for Node, Web, and universal Expo projects.

Installation

yarn add --dev eslint-config-universe

You will also need to install eslint and prettier:

yarn add --dev eslint@8 prettier

Usage

Import this config into your own ESLint configuration using the extends option. ESLint checks both package.json and .eslintrc.* files for its configuration:

package.json

{
  "eslintConfig": {
    // Choose from universe/native, universe/node, universe/web
    "extends": "universe"
  }
}

.eslintrc.js

module.exports = {
  extends: 'universe',
};

Customizing Prettier

If you would like to customize the Prettier settings, create a file named .prettierrc in your project directory. An example of Prettier configuration file:

{
  "printWidth": 100,
  "tabWidth": 2,
  "singleQuote": true,
  "bracketSameLine": true
}

Read more about configuring prettier and all of the available options.

Support for Different Platforms

There are several configs for different platforms. They are:

  • universe: the basic config for JavaScript projects for which there isn't a more specific config,
  • universe/native: the config for React Native projects, including Expo projects, with support for React and JSX,
  • universe/web: the config for code that runs in web browsers, with support for React and JSX,
  • universe/node: the config for code that runs in Node.

For an Expo project, your configuration might look like this:

"eslintConfig": {
  "extends": "universe/native"
}

You also can extend multiple configs, which is useful for projects that span several platforms:

"eslintConfig": {
  "extends": ["universe/node", "universe/web"]
}

Optional Additional TypeScript Typed Linting

Universe also provides optional additional config for typescript-eslint rules that make use of the parsed type information. Note that this may increase the time it takes to run lint for large projects. More information can be found at TypeScript ESLint website.

To enable the additional config, the following changes to your config are required:

.eslintrc.js

module.exports = {
  extends: [
    'universe',
+   'universe/shared/typescript-analysis',
  ],
+ overrides: [
+   {
+     files: [
+       '*.ts',
+       '*.tsx',
+       '*.d.ts'
+     ],
+     parserOptions: {
+       project: './tsconfig.json'
+     },
+   },
+ ],
};

More information on parserOptions.project option can be found in the typescript-eslint repository.

Philosophy

This config is designed to mark severe problems (ex: syntax errors) as errors and stylistic issues as warnings. This lets your team apply policies like, "make sure a commit has no errors but ignore warnings if the commit didn't introduce them."

It's also designed to be a more lenient config for teams who are stronger at decision-making and have a culture of osmotically learning coding guidelines and benefit more from flexibility than rigid rules.

Current Tags

  • 13.0.1-canary-20240628-1ba8152                                ...           canary (5 months ago)
  • 13.0.0                                ...           latest (6 months ago)
  • 13.0.0                                ...           next (6 months ago)
  • 12.0.0                                ...           sdk-50 (a year ago)
  • 12.1.0                                ...           sdk-51 (7 months ago)

68 Versions

  • 13.0.1-canary-20240628-1ba8152                                ...           5 months ago
  • 13.0.1-canary-20240627-1402f4b                                ...           5 months ago
  • 13.0.1-canary-20240625-2333e70                                ...           5 months ago
  • 13.0.0                                ...           6 months ago
  • 12.1.0                                ...           7 months ago
  • 0.0.1-canary-20240418-8d74597                                ...           7 months ago
  • 0.0.1-canary-20240415-cca04d8                                ...           7 months ago
  • 0.0.1-canary-20240415-0868fc4                                ...           7 months ago
  • 12.0.1                                ...           7 months ago
  • 0.0.1-canary-20240411-55a0085                                ...           7 months ago
  • 0.0.1-canary-20240411-33a7dc1                                ...           7 months ago
  • 0.0.1-canary-20240406-a4950c7                                ...           7 months ago
  • 0.0.1-canary-20240405-cdfd9c1                                ...           7 months ago
  • 0.0.1-canary-20240404-e2b8743                                ...           7 months ago
  • 0.0.1-canary-20240328-24ecc5e                                ...           8 months ago
  • 0.0.1-canary-20240327-a7302d9                                ...           8 months ago
  • 0.0.1-canary-20240320-8a10e09                                ...           8 months ago
  • 0.0.1-canary-20240318-dd8f245                                ...           8 months ago
  • 0.0.1-canary-20240318-af634b1                                ...           8 months ago
  • 0.0.1-canary-20240318-53194f5                                ...           8 months ago
  • 0.0.1-canary-20240315-ce71005                                ...           8 months ago
  • 0.0.1-canary-20240308-6715875                                ...           8 months ago
  • 0.0.1-canary-20240305-e60019e                                ...           8 months ago
  • 0.0.1-canary-20240228-7cee619                                ...           9 months ago
  • 0.0.1-canary-20240222-c729a13                                ...           9 months ago
  • 0.0.1-canary-20240109-93608d8                                ...           10 months ago
  • 0.0.1-canary-20231205-250b31f                                ...           a year ago
  • 0.0.1-canary-20231130-c8a9bf9                                ...           a year ago
  • 0.0.1-canary-20231130-ede75a7-1                                ...           a year ago
  • 0.0.1-canary-20231130-ede75a7                                ...           a year ago
  • 0.0.1-canary-20231129-c0ec023                                ...           a year ago
  • 0.0.1-canary-20231125-d600e44                                ...           a year ago
  • 0.0.0-canary-20231123-1b19f96                                ...           a year ago
  • 12.0.0                                ...           a year ago
  • 11.3.0                                ...           2 years ago
  • 11.2.0                                ...           2 years ago
  • 11.1.1                                ...           2 years ago
  • 11.1.0                                ...           2 years ago
  • 11.0.0                                ...           3 years ago
  • 11.0.0-beta.0                                ...           3 years ago
  • 10.0.0                                ...           3 years ago
  • 10.0.0-rc.0                                ...           3 years ago
  • 9.0.0                                ...           3 years ago
  • 8.0.0                                ...           3 years ago
  • 7.0.1                                ...           4 years ago
  • 7.0.0                                ...           4 years ago
  • 6.0.1                                ...           4 years ago
  • 6.0.0                                ...           4 years ago
  • 5.0.0                                ...           4 years ago
  • 4.0.0                                ...           4 years ago
  • 3.0.2                                ...           4 years ago
  • 3.0.1                                ...           4 years ago
  • 3.0.0                                ...           5 years ago
  • 3.0.0-beta.0                                ...           5 years ago
  • 2.3.0                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.1.1                                ...           5 years ago
  • 2.1.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 2.0.0-alpha.0                                ...           6 years ago
  • 1.0.7                                ...           7 years ago
  • 1.0.6                                ...           7 years ago
  • 1.0.5                                ...           7 years ago
  • 1.0.4                                ...           7 years ago
  • 1.0.3                                ...           7 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE