@geprom/eslint-prettier-sapient
v1.0.5
Published
ESLint and Prettier configuration for Geprom Sapient projects with snake_case and camelCase support
Readme
@geprom/eslint-prettier-sapient
ESLint and Prettier configuration for Geprom Sapient projects with support for both camelCase and snake_case naming conventions.
Installation
npm i @geprom/eslint-prettier-sapientFeatures
- ✅ Airbnb ESLint ruleset
- ✅ Prettier integration
- ✅ Both camelCase and snake_case naming support
- ✅ Preconfigured globals:
DbCon,DbQuery,logger
Configuration Details
Supported Naming Conventions
Both naming styles are accepted without warnings:
someFunction(camelCase)some_function(snake_case)
Application Globals
These globals are pre-declared and don't require imports, any additional global variable available in Sapient should :
DbCon- Database connection classDbQuery- Database query classlogger- Logger instance
To extend with additional globals:
module.exports = {
extends: ['@geprom/eslint-prettier-sapient'],
globals: {
myCustomGlobal: 'readonly',
},
};ESLint Rules
- camelcase: Flexible naming - accepts both camelCase and snake_case patterns
- jsx-a11y/href-no-hash: Disabled
- react/jsx-filename-extension: Warns for .js files (allows .jsx)
- max-len: 100 character limit with exceptions for comments, URLs, and strings
- react/prop-types: Warning level
- no-unused-vars: Ignores variables starting with underscore
Prettier Options
- printWidth: 100 characters
- singleQuote: true
- trailingComma: 'es5'
- bracketSpacing: true
- semi: true
- useTabs: false
- tabWidth: 2 spaces
- arrowParens: 'always'
Extending the Configuration
You can extend or override rules in your project's .eslintrc.js:
module.exports = {
extends: ['@geprom/eslint-prettier-sapient'],
rules: {
'max-len': ['warn', { code: 120 }], // Override max line length
'no-console': 'warn', // Add custom rule
},
};