@apolitical/eslint-config 2.0.0-rc.0 → 2.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,8 +25,13 @@ yarn add -D @apolitical/eslint-config
25
25
  Link the ESLint configurations from your `package.json`:
26
26
 
27
27
  ```json
28
+ // for node modules
28
29
  "eslintConfig": {
29
- "extends": "@apolitical/eslint-config/base.config"
30
+ "extends": "@apolitical/eslint-config/api.config"
31
+ },
32
+ // in react applications
33
+ "eslintConfig": {
34
+ "extends": "@apolitical/eslint-config/ui.config"
30
35
  },
31
36
  "prettier": "@apolitical/eslint-config/prettier.config",
32
37
  ```
package/api.config.js CHANGED
@@ -1,14 +1,16 @@
1
- "use strict";
2
- const { parserOptions, env, commonRules } = require('./eslint.settings');
3
-
4
- env.node = true
1
+ 'use strict';
2
+ const { commonRules, env, rules, parserOptions } = require('./base.settings');
5
3
 
6
4
  module.exports = {
7
5
  parserOptions,
8
- env,
9
- "extends": [
6
+ 'env': {
7
+ ...env,
8
+ node: true,
9
+ },
10
+ 'extends': [
10
11
  ...commonRules,
11
- "plugin:jest/recommended"
12
+ 'plugin:jest/recommended'
12
13
  ],
13
- "plugins": ["jest"]
14
+ 'plugins': ['jest'],
15
+ rules,
14
16
  };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@apolitical/eslint-config",
3
- "version": "2.0.0-rc.0",
3
+ "version": "2.0.0-rc.3",
4
4
  "description": "Apolitical ESLint and Prettier configurations",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",
7
7
  "main": "api.config.js",
8
8
  "files": [
9
9
  "api.config.js",
10
+ "eslint.settings.js",
10
11
  "prettier.config.js",
11
12
  "ui.config.js"
12
13
  ],
@@ -25,7 +26,7 @@
25
26
  "dependencies": {
26
27
  "eslint": "8.11.0",
27
28
  "eslint-config-prettier": "8.5.0",
28
- "eslint-plugin-jest": "26.1.1",
29
+ "eslint-plugin-jest": "26.1.3",
29
30
  "prettier": "2.6.0"
30
31
  },
31
32
  "peerDependencies": {
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = {
4
- "useTabs": false,
5
- "printWidth": 120,
6
- "tabWidth": 2,
7
- "singleQuote": true,
8
- "trailingComma": "all"
4
+ 'useTabs': false,
5
+ 'printWidth': 120,
6
+ 'tabWidth': 2,
7
+ 'singleQuote': true,
8
+ 'trailingComma': 'all'
9
9
  };
package/ui.config.js CHANGED
@@ -1,31 +1,33 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
- const { parserOptions: ps, env, commonRules } = require('./eslint.settings');
3
+ const { commonRules, env, parserOptions, rules } = require('./base.settings');
4
4
 
5
- const parserOptions = Object.assign(ps,
6
- {
7
- "sourceType": "module",
8
- "ecmaFeatures": {
9
- "jsx": true
5
+ module.exports = {
6
+ parserOptions: {
7
+ ...parserOptions,
8
+ 'sourceType': 'module',
9
+ 'ecmaFeatures': {
10
+ 'jsx': true
10
11
  }
11
- }
12
- );
13
-
14
- env.browser = true;
15
12
 
16
- module.exports = {
17
- parserOptions,
18
- env,
19
- "extends": [
13
+ },
14
+ env: {
15
+ ...env,
16
+ browser: true
17
+ },
18
+ 'extends': [
20
19
  ...commonRules,
21
- "react-app",
22
- "react-app/jest"
20
+ 'react-app',
21
+ 'react-app/jest'
23
22
  ],
24
- "rules": {
25
- "strict": ["error", "never"],
26
- "no-duplicate-imports": "warn",
27
- "no-empty-function": "warn",
28
- "no-return-await": "error"
23
+ 'rules': {
24
+ ...rules,
25
+ 'strict': ['error', 'never'],
26
+ 'no-duplicate-imports': 'warn',
27
+ 'no-empty-function': 'warn',
28
+ 'react-hooks/exhaustive-deps': 'off',
29
+ 'testing-library/no-render-in-setup': 'warn',
30
+ 'testing-library/prefer-screen-queries': 'warn'
29
31
  },
30
- "ignorePatterns": ["locales"]
32
+ 'ignorePatterns': ['locales']
31
33
  };