Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-config-itself

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-config-itself - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

8

dist/index.js

@@ -1,5 +0,7 @@

import { rules } from "./rules";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const rules_1 = require("./rules");
const plugin = {
rules,
rules: rules_1.rules,
};
export default plugin;
exports.default = plugin;

@@ -1,4 +0,7 @@

import { rule as maxWarnLevelRules } from './max-warn-level-rules';
export const rules = {
'max-warn-level-rules': maxWarnLevelRules,
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rules = void 0;
const max_warn_level_rules_1 = require("./max-warn-level-rules");
exports.rules = {
'max-warn-level-rules': max_warn_level_rules_1.rule,
};

@@ -1,12 +0,15 @@

import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils';
import { getFilename } from '@typescript-eslint/utils/eslint-utils';
export const name = 'max-warn-level-rules';
const createRule = ESLintUtils.RuleCreator((name) => 'eslint-plugin-config-itself/' + name);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rule = exports.name = void 0;
const utils_1 = require("@typescript-eslint/utils");
const eslint_utils_1 = require("@typescript-eslint/utils/eslint-utils");
exports.name = 'max-warn-level-rules';
const createRule = utils_1.ESLintUtils.RuleCreator((name) => 'eslint-plugin-config-itself/' + name);
function countWarnInRules(rules) {
if (rules && rules.type === AST_NODE_TYPES.Property && rules.value.type === AST_NODE_TYPES.ObjectExpression) {
if (rules && rules.type === utils_1.AST_NODE_TYPES.Property && rules.value.type === utils_1.AST_NODE_TYPES.ObjectExpression) {
const warnRulesCount = rules.value.properties.filter((property) => {
if (property.type === AST_NODE_TYPES.Property && property.value.type === AST_NODE_TYPES.Literal && property.value.value === 'warn') {
if (property.type === utils_1.AST_NODE_TYPES.Property && property.value.type === utils_1.AST_NODE_TYPES.Literal && property.value.value === 'warn') {
return true;
}
if (property.type === AST_NODE_TYPES.Property && property.value.type === AST_NODE_TYPES.ArrayExpression && property.value.elements[0]?.type === AST_NODE_TYPES.Literal && property.value.elements[0]?.value === 'warn') {
if (property.type === utils_1.AST_NODE_TYPES.Property && property.value.type === utils_1.AST_NODE_TYPES.ArrayExpression && property.value.elements[0]?.type === utils_1.AST_NODE_TYPES.Literal && property.value.elements[0]?.value === 'warn') {
return true;

@@ -20,4 +23,4 @@ }

}
export const rule = createRule({
name,
exports.rule = createRule({
name: exports.name,
meta: {

@@ -48,3 +51,3 @@ type: 'problem',

create(context, [{ max }]) {
if (!['.eslintrc.js', '.eslintrc.cjs'].includes(getFilename(context))) {
if (!['.eslintrc.js', '.eslintrc.cjs'].includes((0, eslint_utils_1.getFilename)(context))) {
return {};

@@ -57,4 +60,4 @@ }

const rules = properties.find((property) => {
return (property.type === AST_NODE_TYPES.Property && property.key.type === AST_NODE_TYPES.Literal && property.key.value === 'rules') ||
(property.type === AST_NODE_TYPES.Property && property.key.type === AST_NODE_TYPES.Identifier && property.key.name === 'rules');
return (property.type === utils_1.AST_NODE_TYPES.Property && property.key.type === utils_1.AST_NODE_TYPES.Literal && property.key.value === 'rules') ||
(property.type === utils_1.AST_NODE_TYPES.Property && property.key.type === utils_1.AST_NODE_TYPES.Identifier && property.key.name === 'rules');
});

@@ -61,0 +64,0 @@ total += countWarnInRules(rules);

{
"name": "eslint-plugin-config-itself",
"version": "1.0.1",
"version": "1.0.2",
"description": "ESLint plugin for ESLint config itself",

@@ -5,0 +5,0 @@ "type": "commonjs",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc