eslint-plugin-putout 16.2.1 → 16.3.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.
Files changed (2) hide show
  1. package/lib/config/index.js +14 -17
  2. package/package.json +2 -2
@@ -1,42 +1,39 @@
1
1
  'use strict';
2
2
 
3
- const putoutPlugin = require('..');
4
3
  const nPlugin = require('eslint-plugin-n');
5
-
6
4
  const {FlatCompat} = require('@eslint/eslintrc');
5
+ const putoutPlugin = require('..');
6
+
7
+ const getPutoutConfig = (name) => compat.config(putoutPlugin.configs[name]);
7
8
 
8
9
  const compat = new FlatCompat({
9
10
  baseDirectory: __dirname,
10
11
  });
11
12
 
12
- const rmPlugins = (a) => {
13
- delete a.plugins;
14
- return a;
15
- };
16
-
17
- const nPluginReady = compat.config(nPlugin.configs.recommended).map(rmPlugins);
13
+ const n = compat.config(nPlugin.configs.recommended);
18
14
 
19
- const config = [{
15
+ const plugins = [{
20
16
  plugins: {
21
17
  putout: putoutPlugin,
22
18
  },
23
19
  }];
24
20
 
25
21
  module.exports.recommended = [
26
- ...nPluginReady,
27
- ...compat.config(putoutPlugin.configs.recommended),
28
- ...config,
22
+ ...n,
23
+ ...getPutoutConfig('recommended'),
24
+ ...plugins,
29
25
  ];
30
26
 
31
27
  module.exports.safe = [
32
- ...nPluginReady,
28
+ ...n,
33
29
  ...compat.config(putoutPlugin.configs.safe),
34
- ...config,
30
+ ...getPutoutConfig('safe'),
31
+ ...plugins,
35
32
  ];
36
33
 
37
34
  module.exports.safeAlign = [
38
- ...nPluginReady,
39
- ...compat.config(putoutPlugin.configs['safe+align']),
40
- ...config,
35
+ ...n,
36
+ ...getPutoutConfig('safe+align'),
37
+ ...plugins,
41
38
  ];
42
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-putout",
3
- "version": "16.2.1",
3
+ "version": "16.3.0",
4
4
  "type": "commonjs",
5
5
  "description": "ESLint plugin for 🐊Putout",
6
6
  "release": false,
@@ -64,7 +64,7 @@
64
64
  "mocha": "^10.0.0",
65
65
  "montag": "^1.0.0",
66
66
  "simport": "^1.2.0",
67
- "supertape": "^7.0.0",
67
+ "supertape": "^8.0.0",
68
68
  "try-to-catch": "^3.0.0"
69
69
  },
70
70
  "engines": {