@apolitical/eslint-config 2.0.0-rc.1 → 2.0.0

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/CHANGELOG.md CHANGED
@@ -5,11 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [2.0.0] - 2022-03-18
8
+ ## [2.0.0] - 2022-04-01
9
9
  ### Added
10
10
  - eslint-config-prettier
11
11
  - eslint configurations for react
12
- - eslint.settings.js
12
+ - eslint.config.js
13
13
  ### Deprecated
14
14
  - eslint-plugin-prettier
15
15
  ### Changed
package/api.config.js CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";
2
- const { parserOptions, env, commonRules } = require('./eslint.settings');
1
+ 'use strict';
3
2
 
4
- env.node = true
3
+ const { commonRules, env, rules, parserOptions } = require('./base.config');
5
4
 
6
5
  module.exports = {
7
6
  parserOptions,
8
- env,
9
- "extends": [
10
- ...commonRules,
11
- "plugin:jest/recommended"
12
- ],
13
- "plugins": ["jest"]
7
+ env: {
8
+ ...env,
9
+ node: true,
10
+ },
11
+ extends: [...commonRules, 'plugin:jest/recommended'],
12
+ plugins: ['jest'],
13
+ rules,
14
14
  };
package/base.config.js ADDED
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ env: {
5
+ es2021: true,
6
+ jest: true,
7
+ },
8
+ parserOptions: {
9
+ ecmaVersion: 2021,
10
+ },
11
+ commonRules: ['eslint:recommended', 'eslint-config-prettier'],
12
+ rules: {
13
+ 'no-return-await': 'error',
14
+ 'jest/expect-expect': 'off',
15
+ },
16
+ };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@apolitical/eslint-config",
3
- "version": "2.0.0-rc.1",
3
+ "version": "2.0.0",
4
4
  "description": "Apolitical ESLint and Prettier configurations",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",
7
- "main": "api.config.js",
7
+ "main": "base.config.js",
8
8
  "files": [
9
9
  "api.config.js",
10
+ "base.config.js",
10
11
  "prettier.config.js",
11
12
  "ui.config.js"
12
13
  ],
@@ -23,16 +24,16 @@
23
24
  "Node Modules"
24
25
  ],
25
26
  "dependencies": {
26
- "eslint": "8.11.0",
27
+ "eslint": "8.12.0",
27
28
  "eslint-config-prettier": "8.5.0",
28
- "eslint-plugin-jest": "26.1.1",
29
- "prettier": "2.6.0"
29
+ "eslint-plugin-jest": "26.1.3",
30
+ "prettier": "2.6.1"
30
31
  },
31
32
  "peerDependencies": {
32
- "eslint": "8.11.0",
33
+ "eslint": "8.12.0",
33
34
  "eslint-config-prettier": "8.5.0",
34
- "eslint-plugin-jest": "26.1.1",
35
- "prettier": "2.6.0"
35
+ "eslint-plugin-jest": "26.1.3",
36
+ "prettier": "2.6.1"
36
37
  },
37
38
  "engines": {
38
39
  "node": ">=16.13.0"
@@ -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,34 +1,28 @@
1
- "use strict";
1
+ 'use strict';
2
2
 
3
- const { parserOptions: ps, env, commonRules } = require('./eslint.settings');
4
-
5
- const parserOptions = Object.assign(ps,
6
- {
7
- "sourceType": "module",
8
- "ecmaFeatures": {
9
- "jsx": true
10
- }
11
- }
12
- );
13
-
14
- env.browser = true;
3
+ const { commonRules, env, parserOptions, rules } = require('./base.config');
15
4
 
16
5
  module.exports = {
17
- parserOptions,
18
- env,
19
- "extends": [
20
- ...commonRules,
21
- "react-app",
22
- "react-app/jest"
23
- ],
24
- "rules": {
25
- "strict": ["error", "never"],
26
- "no-duplicate-imports": "warn",
27
- "no-empty-function": "warn",
28
- "no-return-await": "error",
29
- "react-hooks/exhaustive-deps": "off",
30
- "testing-library/no-render-in-setup": "warn",
31
- "testing-library/prefer-screen-queries": "warn"
6
+ parserOptions: {
7
+ ...parserOptions,
8
+ sourceType: 'module',
9
+ ecmaFeatures: {
10
+ jsx: true,
11
+ },
12
+ },
13
+ env: {
14
+ ...env,
15
+ browser: true,
16
+ },
17
+ extends: [...commonRules, 'react-app', 'react-app/jest'],
18
+ rules: {
19
+ ...rules,
20
+ strict: ['error', 'never'],
21
+ 'no-duplicate-imports': 'warn',
22
+ 'no-empty-function': 'warn',
23
+ 'react-hooks/exhaustive-deps': 'off',
24
+ 'testing-library/no-render-in-setup': 'warn',
25
+ 'testing-library/prefer-screen-queries': 'warn',
32
26
  },
33
- "ignorePatterns": ["locales"]
27
+ ignorePatterns: ['locales'],
34
28
  };