eslint-plugin-universe
v1.0.1
Published
ESLint plugin with Expo-specific rules
Readme
eslint-plugin-universe
ESLint plugin with Expo-specific rules.
Installation
npm install --save-dev eslint-plugin-universeRequires ESLint 9 or later.
Usage
Add the plugin to your ESLint flat config:
import universe from 'eslint-plugin-universe';
export default [
{
plugins: {
universe,
},
rules: {
'universe/require-error-name': 'warn',
},
},
];Or use the recommended config:
import universe from 'eslint-plugin-universe';
export default [universe.configs.recommended];Rules
require-error-name
Requires Error subclasses to set prototype.name to the class name. This ensures error names are preserved after minification and appear correctly in stack traces.
Valid
class MyError extends Error {
static {
this.prototype.name = 'MyError';
}
}Invalid
// Missing name assignment
class MyError extends Error {}
// Wrong name value
class MyError extends Error {
static {
this.prototype.name = 'WrongName';
}
}This rule is auto-fixable with --fix.
