cleanup, update to eslint 7

This commit is contained in:
Timo Hocker 2020-05-13 20:38:48 +02:00
parent a02dd372b9
commit ef47d37d9d
5 changed files with 18 additions and 22 deletions

2
Jenkinsfile vendored
View File

@ -5,7 +5,7 @@ pipeline {
VERSION = VersionNumber([ VERSION = VersionNumber([
versionNumberString: versionNumberString:
'${BUILDS_ALL_TIME}', '${BUILDS_ALL_TIME}',
versionPrefix: '2.0.', versionPrefix: '2.1.',
worstResultForIncrement: 'SUCCESS' worstResultForIncrement: 'SUCCESS'
]) ])
} }

View File

@ -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 ## Installation
to install this module you have to add the following line to your .npmrc npm:
```npmrc > npm i --save-dev @sapphirecode/eslint-config
@scode:registry=https://npm.scode.ovh
```
then install the module and eslint yarn:
```sh > yarn add --dev @sapphirecode/eslint-config
npm i --save-dev @scode/eslint-config eslint
```
then create a file named .eslintrc.js with the following contents. 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

View File

@ -34,7 +34,6 @@ module.exports = {
// Best Practices https://eslint.org/docs/rules/#best-practices // Best Practices https://eslint.org/docs/rules/#best-practices
'array-callback-return': ['error', { allowImplicit: false }], 'array-callback-return': ['error', { allowImplicit: false }],
'block-scoped-var': 'error', 'block-scoped-var': 'error',
'class-methods-use-this': 'off',
complexity: ['warn', { max: 15 }], complexity: ['warn', { max: 15 }],
'consistent-return': ['error', { treatUndefinedAsUnspecified: false }], 'consistent-return': ['error', { treatUndefinedAsUnspecified: false }],
curly: ['error', 'multi-or-nest', 'consistent'], curly: ['error', 'multi-or-nest', 'consistent'],
@ -66,7 +65,6 @@ module.exports = {
'no-iterator': 'error', 'no-iterator': 'error',
'no-lone-blocks': 'error', 'no-lone-blocks': 'error',
'no-loop-func': 'error', 'no-loop-func': 'error',
'no-magic-numbers': 'off',
'no-multi-spaces': 'error', 'no-multi-spaces': 'error',
'no-multi-str': 'error', 'no-multi-str': 'error',
'no-new': 'error', 'no-new': 'error',
@ -137,7 +135,6 @@ module.exports = {
'consistent-this': 'error', 'consistent-this': 'error',
'eol-last': 'error', 'eol-last': 'error',
'func-call-spacing': ['error', 'always'], 'func-call-spacing': ['error', 'always'],
'no-spaced-func': 'off',
'func-name-matching': ['error', 'always'], 'func-name-matching': ['error', 'always'],
'func-names': ['error', 'always'], 'func-names': ['error', 'always'],
'func-style': ['error', 'declaration', { allowArrowFunctions: true }], 'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
@ -293,7 +290,6 @@ module.exports = {
// node // node
'node/exports-style': 'error', 'node/exports-style': 'error',
'node/file-extension-in-import': 'off',
'node/prefer-global/buffer': 'error', 'node/prefer-global/buffer': 'error',
'node/prefer-global/console': 'error', 'node/prefer-global/console': 'error',
'node/prefer-global/process': 'error', 'node/prefer-global/process': 'error',
@ -302,8 +298,6 @@ module.exports = {
'node/prefer-global/url-search-params': 'error', 'node/prefer-global/url-search-params': 'error',
'node/prefer-global/url': 'error', 'node/prefer-global/url': 'error',
'node/prefer-promises/dns': '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/sort-requires-by-path': 'error' 'sort-requires-by-path/sort-requires-by-path': 'error'

View File

@ -26,12 +26,12 @@ if (typeof pkg.repository === 'undefined') {
} }
function major (version) { function major (version) {
return version.replace (/\.[0-9]+$/ui, ''); return version.replace (/\.[0-9x]+$/ui, '');
} }
if (fs.existsSync ('README.md')) { if (fs.existsSync ('README.md')) {
const readme = fs.readFileSync ('README.md', 'utf-8'); 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 ( if (
version === null version === null
|| major (version[1]) !== major (pkg.version) || major (version[1]) !== major (pkg.version)

View File

@ -14,7 +14,7 @@
"url": "https://git.scode.ovh/timo/scode-eslint-config.git" "url": "https://git.scode.ovh/timo/scode-eslint-config.git"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": ">=6.8.0" "eslint": ">=7.0.0"
}, },
"keywords": [ "keywords": [
"eslint", "eslint",