
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
eslint-plugin-php
Advanced tools
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.
npm i -D eslint-plugin-php
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,
},
]);
🔧 - Automatically fixable by the --fix CLI option.
💡 - Manually fixable by editor suggestions.
✅ - Enabled in the recommended configuration.
| Rule ID | Description | 🔧 | 💡 | ✅ |
|---|---|---|---|---|
php/disallow-references | Disallow the use of references | 💡 | ✅ | |
php/eqeqeq | Require the use of === and !== | ✅ | ||
php/no-array-keyword | Disallow the use of the array keyword | 🔧 | ✅ | |
php/no-final | Disallow using the final keyword | 💡 | ✅ | |
php/require-visibility | Require visibility for class methods and properties | 💡 | ✅ |
Contributions are welcome! Please read the contributing guidelines for more information.
FAQs
An ESLint plugin to lint PHP files
The npm package eslint-plugin-php receives a total of 3 weekly downloads. As such, eslint-plugin-php popularity was classified as not popular.
We found that eslint-plugin-php demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.