Registry /
testing / eslint-plugin-no-function-declare-after-return
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
plugin
✓ // In .eslintrc: { "plugins": ["no-function-declare-after-return"], "rules": { "no-function-declare-after-return/no-function-declare-after-return": "error" } }
✗ // Incorrect: { "rules": { "no-function-declare-after-return": "error" } } (omits plugin name prefix)
The rule is namespaced under the plugin name, unlike built-in rules. Always use 'no-function-declare-after-return/no-function-declare-after-return'.
flat config (ESLint 9+)
✓ import noFunctionDeclareAfterReturn from 'eslint-plugin-no-function-declare-after-return';
export default [noFunctionDeclareAfterReturn.configs.recommended];
✗ // Incorrect: using .eslintrc style with flat config or importing incorrectly
For ESLint 9+ flat config, import the plugin and spread its config. The recommended config includes the rule.
CommonJS require
✓ const plugin = require('eslint-plugin-no-function-declare-after-return');
// In .eslintrc: plugins: ["no-function-declare-after-return"], rules: { ... }
✗ // Incorrect: const plugin = require('eslint-plugin-no-function-declare-after-return/no-function-declare-after-return');
Require the plugin package, not the rule file. The plugin object is exported as a default.
Configures ESLint to disallow function declarations after return, with a failing example.
// .eslintrc.js
module.exports = {
plugins: ['no-function-declare-after-return'],
rules: {
'no-function-declare-after-return/no-function-declare-after-return': 'error',
},
};
// Example file that will fail:
function foo() {
return 1;
function bar() { return 2; }
}
Errors
Common errors & fixes
Error: Failed to load plugin 'no-function-declare-after-return': Unable to load rule 'no-function-declare-after-return/no-function-declare-after-return'
The rule name is incorrectly spelled or the plugin isn't installed.
fixnpm install --save-dev eslint-plugin-no-function-declare-after-return and ensure the rule name is 'no-function-declare-after-return/no-function-declare-after-return'.
ESLint: Configuration for rule 'no-function-declare-after-return' is unknown
Used rule name without plugin prefix in flat config or missing plugin declaration.
fixAdd 'no-function-declare-after-return' to the plugins array and prefix the rule: 'no-function-declare-after-return/no-function-declare-after-return'.
Audit
Dependencies
No dependency data recorded yet.