eslint-plugin-eslint-plugin
Advanced tools
Comparing version 5.4.1 to 5.5.0
@@ -0,8 +1,10 @@ | ||
/** | ||
* @deprecated use 'flat/all-type-checked' instead | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
*/ | ||
'use strict'; | ||
const mod = require('../lib/index.js'); | ||
const plugin = require('../lib/index.js'); | ||
module.exports = { | ||
plugins: { 'eslint-plugin': mod }, | ||
rules: mod.configs['all-type-checked'].rules, | ||
}; | ||
module.exports = plugin.configs['flat/all-type-checked']; |
/** | ||
* @fileoverview the `all` config for `eslint.config.js` | ||
* @deprecated use 'flat/all' instead | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
@@ -8,7 +9,4 @@ */ | ||
const mod = require('../lib/index.js'); | ||
const plugin = require('../lib/index.js'); | ||
module.exports = { | ||
plugins: { 'eslint-plugin': mod }, | ||
rules: mod.configs.all.rules, | ||
}; | ||
module.exports = plugin.configs['flat/all']; |
/** | ||
* @fileoverview the `recommended` config for `eslint.config.js` | ||
* @deprecated use 'flat/recommended' instead | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
@@ -8,7 +9,4 @@ */ | ||
const mod = require('../lib/index.js'); | ||
const plugin = require('../lib/index.js'); | ||
module.exports = { | ||
plugins: { 'eslint-plugin': mod }, | ||
rules: mod.configs.recommended.rules, | ||
}; | ||
module.exports = plugin.configs['flat/recommended']; |
/** | ||
* @fileoverview the `rules-recommended` config for `eslint.config.js` | ||
* @deprecated use 'flat/rules-recommended' instead | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
@@ -8,7 +9,4 @@ */ | ||
const mod = require('../lib/index.js'); | ||
const plugin = require('../lib/index.js'); | ||
module.exports = { | ||
plugins: { 'eslint-plugin': mod }, | ||
rules: mod.configs['rules-recommended'].rules, | ||
}; | ||
module.exports = plugin.configs['flat/rules-recommended']; |
/** | ||
* @fileoverview the `rules` config for `eslint.config.js` | ||
* @deprecated use 'flat/rules' instead | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
@@ -8,7 +9,4 @@ */ | ||
const mod = require('../lib/index.js'); | ||
const plugin = require('../lib/index.js'); | ||
module.exports = { | ||
plugins: { 'eslint-plugin': mod }, | ||
rules: mod.configs.rules.rules, | ||
}; | ||
module.exports = plugin.configs['flat/rules']; |
/** | ||
* @fileoverview the `tests-recommended` config for `eslint.config.js` | ||
* @deprecated use 'flat/tests-recommended' instead | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
@@ -8,7 +9,4 @@ */ | ||
const mod = require('../lib/index.js'); | ||
const plugin = require('../lib/index.js'); | ||
module.exports = { | ||
plugins: { 'eslint-plugin': mod }, | ||
rules: mod.configs['tests-recommended'].rules, | ||
}; | ||
module.exports = plugin.configs['flat/tests-recommended']; |
/** | ||
* @fileoverview the `tests` config for `eslint.config.js` | ||
* @deprecated use 'flat/tests' instead | ||
* @author 唯然<weiran.zsd@outlook.com> | ||
@@ -8,7 +9,4 @@ */ | ||
const mod = require('../lib/index.js'); | ||
const plugin = require('../lib/index.js'); | ||
module.exports = { | ||
plugins: { 'eslint-plugin': mod }, | ||
rules: mod.configs.tests.rules, | ||
}; | ||
module.exports = plugin.configs['flat/tests']; |
@@ -45,11 +45,15 @@ /** | ||
module.exports.meta = { | ||
name: packageMetadata.name, | ||
version: packageMetadata.version, | ||
const plugin = { | ||
meta: { | ||
name: packageMetadata.name, | ||
version: packageMetadata.version, | ||
}, | ||
rules: allRules, | ||
configs: {}, // assigned later | ||
}; | ||
module.exports.rules = allRules; | ||
module.exports.configs = Object.keys(configFilters).reduce( | ||
(configs, configName) => { | ||
// eslintrc configs | ||
Object.assign( | ||
plugin.configs, | ||
Object.keys(configFilters).reduce((configs, configName) => { | ||
return Object.assign(configs, { | ||
@@ -65,4 +69,22 @@ [configName]: { | ||
}); | ||
}, | ||
{} | ||
}, {}) | ||
); | ||
// flat configs | ||
Object.assign( | ||
plugin.configs, | ||
Object.keys(configFilters).reduce((configs, configName) => { | ||
return Object.assign(configs, { | ||
[`flat/${configName}`]: { | ||
plugins: { 'eslint-plugin': plugin }, | ||
rules: Object.fromEntries( | ||
Object.keys(allRules) | ||
.filter((ruleName) => configFilters[configName](allRules[ruleName])) | ||
.map((ruleName) => [`${PLUGIN_NAME}/${ruleName}`, 'error']) | ||
), | ||
}, | ||
}); | ||
}, {}) | ||
); | ||
module.exports = plugin; |
{ | ||
"name": "eslint-plugin-eslint-plugin", | ||
"version": "5.4.1", | ||
"version": "5.5.0", | ||
"description": "An ESLint plugin for linting ESLint plugins", | ||
@@ -56,5 +56,5 @@ "author": "Teddy Katz", | ||
"@eslint/eslintrc": "^2.0.2", | ||
"@eslint/js": "^8.37.0", | ||
"@eslint/js": "^8.57.0", | ||
"@release-it/conventional-changelog": "^4.3.0", | ||
"@types/eslint": "^8.56.2", | ||
"@types/eslint": "^8.56.6", | ||
"@types/estree": "^1.0.5", | ||
@@ -65,3 +65,3 @@ "@typescript-eslint/parser": "^5.62.0", | ||
"dirty-chai": "^2.0.1", | ||
"eslint": "^8.23.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-not-an-aardvark": "^2.1.0", | ||
@@ -83,9 +83,9 @@ "eslint-config-prettier": "^8.5.0", | ||
"markdownlint-cli": "^0.39.0", | ||
"mocha": "^10.0.0", | ||
"npm-package-json-lint": "^7.0.0", | ||
"npm-run-all2": "^5.0.0", | ||
"mocha": "^10.4.0", | ||
"npm-package-json-lint": "^7.1.0", | ||
"npm-run-all2": "^6.1.2", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.7.1", | ||
"release-it": "^14.14.3", | ||
"typescript": "^5.1.3" | ||
"typescript": "^5.4.3" | ||
}, | ||
@@ -92,0 +92,0 @@ "peerDependencies": { |
@@ -50,5 +50,2 @@ # eslint-plugin-eslint-plugin ![CI](https://github.com/eslint-community/eslint-plugin-eslint-plugin/workflows/CI/badge.svg) [![NPM version](https://img.shields.io/npm/v/eslint-plugin-eslint-plugin.svg?style=flat)](https://npmjs.org/package/eslint-plugin-eslint-plugin) [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) <!-- omit from toc --> | ||
{ | ||
"parserOptions": { | ||
"sourceType": "script" | ||
}, | ||
"extends": ["plugin:eslint-plugin/recommended"], | ||
@@ -64,7 +61,6 @@ "rules": { | ||
```js | ||
const eslintPluginRecommended = require('eslint-plugin-eslint-plugin/configs/recommended'); | ||
const eslintPlugin = require('eslint-plugin-eslint-plugin'); | ||
module.exports = [ | ||
eslintPluginRecommended, | ||
eslintPlugin.configs['flat/recommended'], | ||
{ | ||
languageOptions: { sourceType: 'commonjs' }, | ||
rules: { | ||
@@ -144,4 +140,13 @@ 'eslint-plugin/require-meta-docs-description': 'error', | ||
Presets are enabled by adding a line to the `extends` list in your config file. For example, to enable the `recommended` preset, use: | ||
Both flat and eslintrc configs are supported. For example, to enable the `recommended` preset, use: | ||
eslint.config.js | ||
```js | ||
const eslintPlugin = require('eslint-plugin-eslint-plugin'); | ||
module.exports = [eslintPlugin.configs['flat/recommended']]; | ||
``` | ||
.eslintrc.json | ||
```json | ||
@@ -155,2 +160,20 @@ { | ||
eslint.config.js | ||
```js | ||
const eslintPlugin = require('eslint-plugin-eslint-plugin'); | ||
module.exports = [ | ||
{ | ||
files: ['lib/rules/*.{js,ts}'], | ||
...eslintPlugin.configs['flat/rules-recommended'], | ||
}, | ||
{ | ||
files: ['tests/lib/rules/*.{js,ts}'], | ||
...eslintPlugin.configs['flat/tests-recommended'], | ||
}, | ||
]; | ||
``` | ||
.eslintrc.js | ||
```json | ||
@@ -157,0 +180,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
155843
3811
189