cleanup, update to eslint 7
This commit is contained in:
parent
a02dd372b9
commit
ef47d37d9d
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -5,7 +5,7 @@ pipeline {
|
||||
VERSION = VersionNumber([
|
||||
versionNumberString:
|
||||
'${BUILDS_ALL_TIME}',
|
||||
versionPrefix: '2.0.',
|
||||
versionPrefix: '2.1.',
|
||||
worstResultForIncrement: 'SUCCESS'
|
||||
])
|
||||
}
|
||||
|
24
README.md
24
README.md
@ -1,20 +1,20 @@
|
||||
# Sapphirecode ESLint configuration
|
||||
# @sapphirecode/eslint-config
|
||||
|
||||
Javascript coding standard used by Sapphirecode
|
||||
[![Package quality](https://packagequality.com/badge/%40sapphirecode%2Feslint-config)](https://packagequality.com/#?package=%40sapphirecode%2Feslint-config)
|
||||
|
||||
version: 2.1.x
|
||||
|
||||
scode eslint standard configuration
|
||||
|
||||
## Installation
|
||||
|
||||
to install this module you have to add the following line to your .npmrc
|
||||
npm:
|
||||
|
||||
```npmrc
|
||||
@scode:registry=https://npm.scode.ovh
|
||||
```
|
||||
> npm i --save-dev @sapphirecode/eslint-config
|
||||
|
||||
then install the module and eslint
|
||||
yarn:
|
||||
|
||||
```sh
|
||||
npm i --save-dev @scode/eslint-config eslint
|
||||
```
|
||||
> yarn add --dev @sapphirecode/eslint-config
|
||||
|
||||
then create a file named .eslintrc.js with the following contents.
|
||||
|
||||
@ -33,4 +33,6 @@ module.exports = {
|
||||
}
|
||||
```
|
||||
|
||||
after that you can run eslint.
|
||||
## License
|
||||
|
||||
BSD-3-Clause © Timo Hocker
|
||||
|
6
index.js
6
index.js
@ -34,7 +34,6 @@ module.exports = {
|
||||
// Best Practices https://eslint.org/docs/rules/#best-practices
|
||||
'array-callback-return': ['error', { allowImplicit: false }],
|
||||
'block-scoped-var': 'error',
|
||||
'class-methods-use-this': 'off',
|
||||
complexity: ['warn', { max: 15 }],
|
||||
'consistent-return': ['error', { treatUndefinedAsUnspecified: false }],
|
||||
curly: ['error', 'multi-or-nest', 'consistent'],
|
||||
@ -66,7 +65,6 @@ module.exports = {
|
||||
'no-iterator': 'error',
|
||||
'no-lone-blocks': 'error',
|
||||
'no-loop-func': 'error',
|
||||
'no-magic-numbers': 'off',
|
||||
'no-multi-spaces': 'error',
|
||||
'no-multi-str': 'error',
|
||||
'no-new': 'error',
|
||||
@ -137,7 +135,6 @@ module.exports = {
|
||||
'consistent-this': 'error',
|
||||
'eol-last': 'error',
|
||||
'func-call-spacing': ['error', 'always'],
|
||||
'no-spaced-func': 'off',
|
||||
'func-name-matching': ['error', 'always'],
|
||||
'func-names': ['error', 'always'],
|
||||
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
|
||||
@ -293,7 +290,6 @@ module.exports = {
|
||||
|
||||
// node
|
||||
'node/exports-style': 'error',
|
||||
'node/file-extension-in-import': 'off',
|
||||
'node/prefer-global/buffer': 'error',
|
||||
'node/prefer-global/console': 'error',
|
||||
'node/prefer-global/process': 'error',
|
||||
@ -302,8 +298,6 @@ module.exports = {
|
||||
'node/prefer-global/url-search-params': 'error',
|
||||
'node/prefer-global/url': 'error',
|
||||
'node/prefer-promises/dns': 'error',
|
||||
'node/no-unpublished-require': 'off',
|
||||
'node/no-missing-import': 'off',
|
||||
|
||||
// sort-requires-by-path
|
||||
'sort-requires-by-path/sort-requires-by-path': 'error'
|
||||
|
@ -26,12 +26,12 @@ if (typeof pkg.repository === 'undefined') {
|
||||
}
|
||||
|
||||
function major (version) {
|
||||
return version.replace (/\.[0-9]+$/ui, '');
|
||||
return version.replace (/\.[0-9x]+$/ui, '');
|
||||
}
|
||||
|
||||
if (fs.existsSync ('README.md')) {
|
||||
const readme = fs.readFileSync ('README.md', 'utf-8');
|
||||
const version = (/version: ([0-9.]+)/ui).exec (readme);
|
||||
const version = (/version: ([0-9x.]+)/ui).exec (readme);
|
||||
if (
|
||||
version === null
|
||||
|| major (version[1]) !== major (pkg.version)
|
||||
|
@ -14,7 +14,7 @@
|
||||
"url": "https://git.scode.ovh/timo/scode-eslint-config.git"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=6.8.0"
|
||||
"eslint": ">=7.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"eslint",
|
||||
|
Loading…
x
Reference in New Issue
Block a user