eslint-plugin-putout 16.1.0 → 16.2.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/README.md CHANGED
@@ -160,6 +160,18 @@ Disabled 🐊**Putout** rules:
160
160
 
161
161
  When you want to enable ability to align spaces on empty lines, while have all benefits of `safe` preset: use `safe+align`.
162
162
 
163
+ ## Flat
164
+
165
+ The time is came for a [FlatConfig](https://eslint.org/blog/2022/08/new-config-system-part-2/). To use it with `eslint-plugin-putout` add to `eslint.config.js`:
166
+
167
+ ```js
168
+ const flatPutout = require('eslint-plugin-putout/flat');
169
+ module.exports = [
170
+ ...flatPutout, {
171
+ },
172
+ ];
173
+ ```
174
+
163
175
  ## License
164
176
 
165
177
  MIT
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ const putoutPlugin = require('..');
4
+ const nPlugin = require('eslint-plugin-n');
5
+
6
+ const {FlatCompat} = require('@eslint/eslintrc');
7
+
8
+ const compat = new FlatCompat({
9
+ baseDirectory: __dirname,
10
+ });
11
+
12
+ const rmPlugins = (a) => {
13
+ delete a.plugins;
14
+ return a;
15
+ };
16
+
17
+ const nPluginReady = compat.config(nPlugin.configs.recommended).map(rmPlugins);
18
+
19
+ const config = [{
20
+ plugins: {
21
+ putout: putoutPlugin,
22
+ },
23
+ }];
24
+
25
+ module.exports.recommended = [
26
+ ...nPluginReady,
27
+ ...compat.config(putoutPlugin.configs.recommended),
28
+ ...config,
29
+ ];
30
+
31
+ module.exports.safe = [
32
+ ...nPluginReady,
33
+ ...compat.config(putoutPlugin.configs.safe),
34
+ ...config,
35
+ ];
36
+
37
+ module.exports.safeAlign = [
38
+ ...nPluginReady,
39
+ ...compat.config(putoutPlugin.configs['safe+align']),
40
+ ...config,
41
+ ];
42
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-putout",
3
- "version": "16.1.0",
3
+ "version": "16.2.0",
4
4
  "type": "commonjs",
5
5
  "description": "ESLint plugin for 🐊Putout",
6
6
  "release": false,
@@ -11,6 +11,10 @@
11
11
  "type": "git",
12
12
  "url": "git://github.com/coderaiser/putout.git"
13
13
  },
14
+ "exports": {
15
+ ".": "./lib/index.js",
16
+ "./flat": "./lib/flat/index.js"
17
+ },
14
18
  "keywords": [
15
19
  "putout",
16
20
  "eslint",
@@ -39,8 +43,9 @@
39
43
  "@babel/eslint-parser": "^7.15.0",
40
44
  "@babel/plugin-syntax-class-properties": "^7.12.1",
41
45
  "@babel/traverse": "^7.16.3",
46
+ "@eslint/eslintrc": "^1.3.1",
42
47
  "@putout/engine-parser": "^5.0.0",
43
- "@putout/eslint": "^1.1.0",
48
+ "@putout/eslint": "^1.3.0",
44
49
  "@putout/eslint-config": "^7.0.0",
45
50
  "@typescript-eslint/eslint-plugin": "^5.5.0",
46
51
  "@typescript-eslint/parser": "^5.4.0",