1.9.1 • Published 11 months ago
@regionhalland/eslint-config v1.9.1
@regionhalland/eslint-config
To use this package, the following packages must be installed in the consuming project.
- ESLint
- TypeScript
- Prettier
Recommended installation:
yarn add -D eslint typescript prettier @regionhalland/eslint-config
Sample configuration for package.json:
// package.json
{
...
"script": {
"lint": "eslint ./src",
"lint:fix": "eslint ./src --fix"
}
...
}
Configuration for React application:
@regionhalland/eslint-config
is standard config.@regionhalland/eslint-config/recommended
is recommended config with addition of the plugin simple-import-sort.
// .eslintrc.cjs
module.exports = {
extends: "@regionhalland/eslint-config",
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
"@/features/*/*"
]
}
]
},
};
Configuration for Node.js application:
// .eslintrc.cjs
module.exports = {
extends: "@regionhalland/eslint-config/node",
};
Merge config:
// .eslintrc.cjs
const defaultConfig = require('@regionhalland/eslint-config/recommended');
const { mergeRules } = require('@regionhalland/eslint-config/utils');
// Modify a part of existing rule
const extendedRules = {
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'parameter',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
]
};
const eslintRules = mergeRules(defaultConfig['rules'], extendedRules);
module.exports = {
extends: "@regionhalland/eslint-config/recommended",
rules: {
...eslintRules
},
ignorePatterns: [
"*.cjs"
]
};
1.9.1
11 months ago
1.9.0
11 months ago
1.8.0
1 year ago
1.7.1
1 year ago
1.7.0
1 year ago
1.6.2
1 year ago
1.6.1
1 year ago
1.6.0
1 year ago
1.5.0
1 year ago
1.4.0
2 years ago
1.3.0
2 years ago
1.2.0
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago