New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

eslint-plugin-php

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-php

An ESLint plugin to lint PHP files

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
5
-95.05%
Maintainers
1
Weekly downloads
 
Created
Source

ESLint Plugin PHP

An ESLint plugin to lint PHP files.

[!NOTE]
This is basically a POC for PHP linter using ESLint's new Languages API. It aims to provide a better linting experience than PHP CodeSniffer.

Installation

npm i -D eslint-plugin-php

Usage

Add php as a plugin in your ESLint configuration file, specify the language for the files you want to lint, and configure the rules you want to use:

// eslint.config.mjs
import php from 'eslint-plugin-php';
import { defineConfig } from 'eslint/config';

export default defineConfig([
  {
    files: ['**/*.php'],
    plugins: {
      php,
    },
    language: 'php/php',
    rules: {
      'php/eqeqeq': 'error',
      'php/no-array-keyword': 'error',
    },
  },
]);

You can also use the recommended configuration to enable all recommended rules:

// eslint.config.mjs
import php from 'eslint-plugin-php';
import { defineConfig } from 'eslint/config';

export default defineConfig([
  {
    files: ['./**/*.php'],
    ...php.configs.recommended,
  },
]);

Available Rules

🔧 - Automatically fixable by the --fix CLI option.

💡 - Manually fixable by editor suggestions.

✅ - Enabled in the recommended configuration.

Rule IDDescription🔧💡
php/disallow-referencesDisallow the use of references💡
php/eqeqeqRequire the use of === and !==
php/no-array-keywordDisallow the use of the array keyword🔧
php/no-finalDisallow using the final keyword💡
php/require-visibilityRequire visibility for class methods and properties💡

Contributing

Contributions are welcome! Please read the contributing guidelines for more information.

Keywords

eslint

FAQs

Package last updated on 27 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts