init
This commit is contained in:
commit
fedcd3defb
38
.eslintrc.js
Normal file
38
.eslintrc.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||||
|
* This file is part of SCode-Eslint-Config which is released under BSD-3-Clause.
|
||||||
|
* See file 'LICENSE' for full license details.
|
||||||
|
* Created by Timo Hocker <timo@scode.ovh>, March 2020
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
es6: true,
|
||||||
|
node: true
|
||||||
|
},
|
||||||
|
extends: [
|
||||||
|
'standard'
|
||||||
|
],
|
||||||
|
globals: {
|
||||||
|
Atomics: 'readonly',
|
||||||
|
SharedArrayBuffer: 'readonly'
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 2018,
|
||||||
|
sourceType: 'module'
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
camelcase: 'off',
|
||||||
|
'sort-keys': 'off',
|
||||||
|
'lines-around-comment': 'off',
|
||||||
|
'array-element-newline': 'off',
|
||||||
|
'array-bracket-newline': 'off',
|
||||||
|
'max-len': 'off',
|
||||||
|
'func-call-spacing': 'off',
|
||||||
|
'semi': 'off',
|
||||||
|
'curly': 'off',
|
||||||
|
'strict': 'off',
|
||||||
|
'brace-style': 'off',
|
||||||
|
'no-magic-numbers': 'off'
|
||||||
|
}
|
||||||
|
}
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/node_modules/
|
23
Jenkinsfile
vendored
Normal file
23
Jenkinsfile
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
VERSION = VersionNumber([
|
||||||
|
versionNumberString:
|
||||||
|
'${BUILDS_ALL_TIME}',
|
||||||
|
versionPrefix: '1.0.',
|
||||||
|
worstResultForIncrement: 'SUCCESS'
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Building') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
currentBuild.displayName = env.VERSION
|
||||||
|
}
|
||||||
|
sh 'yarn ci ${VERSION}'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
29
LICENSE
Normal file
29
LICENSE
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
Copyright (c) 2020, Timo Hocker
|
||||||
|
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of scode-eslint-config nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
36
README.md
Normal file
36
README.md
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Sapphirecode ESLint configuration
|
||||||
|
|
||||||
|
Javascript coding standard used by Sapphirecode
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
to install this module you have to add the following line to your .npmrc
|
||||||
|
|
||||||
|
```npmrc
|
||||||
|
@scode:registry=https://npm.scode.ovh
|
||||||
|
```
|
||||||
|
|
||||||
|
then install the module and eslint
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm i --save-dev @scode/eslint-ts eslint
|
||||||
|
```
|
||||||
|
|
||||||
|
then create a file named .eslintrc.js with the following contents.
|
||||||
|
|
||||||
|
it is a basic configuration, it can be customized to your preferences.
|
||||||
|
|
||||||
|
```js
|
||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
commonjs: true,
|
||||||
|
es6: true,
|
||||||
|
node: true
|
||||||
|
},
|
||||||
|
extends: [
|
||||||
|
'@scode/eslint-ts'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
after that you can run eslint.
|
30
index.js
Normal file
30
index.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||||
|
* This file is part of SCode-Eslint-Config which is released under BSD-3-Clause.
|
||||||
|
* See file 'LICENSE' for full license details.
|
||||||
|
* Created by Timo Hocker <timo@scode.ovh>, March 2020
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
|
||||||
|
globals: {},
|
||||||
|
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
|
||||||
|
extends: [
|
||||||
|
'@scode/eslint-es6',
|
||||||
|
'plugin:@typescript-eslint/eslint-recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended'
|
||||||
|
],
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
'@typescript-eslint'
|
||||||
|
],
|
||||||
|
|
||||||
|
parserOptions: {
|
||||||
|
sourceType: 'module',
|
||||||
|
parser: 'babel-eslint'
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {}
|
||||||
|
}
|
34
jenkins.js
Normal file
34
jenkins.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) Sapphirecode - All Rights Reserved
|
||||||
|
* This file is part of SCode-Eslint-Config which is released under BSD-3-Clause.
|
||||||
|
* See file 'LICENSE' for full license details.
|
||||||
|
* Created by Timo Hocker <timo@scode.ovh>, March 2020
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* eslint-disable no-process-exit */
|
||||||
|
/* eslint-disable no-console */
|
||||||
|
/* eslint-disable no-sync */
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const fs = require ('fs');
|
||||||
|
const child_process = require ('child_process');
|
||||||
|
|
||||||
|
const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8'));
|
||||||
|
[
|
||||||
|
,, pkg.version
|
||||||
|
] = process.argv;
|
||||||
|
fs.writeFileSync ('package.json', JSON.stringify (pkg, null, 2));
|
||||||
|
|
||||||
|
child_process.execSync ('yarn lint', { stdio: 'inherit' });
|
||||||
|
if (typeof pkg.scripts !== 'undefined' && typeof pkg.scripts.test === 'string')
|
||||||
|
child_process.execSync ('yarn test', { stdio: 'inherit' });
|
||||||
|
|
||||||
|
child_process.exec ('git log -1 | grep \'\\[no publish\\]\'')
|
||||||
|
.addListener ('exit', (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
console.log ('build not marked for deployment');
|
||||||
|
process.exit (1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
child_process.execSync ('yarn publish');
|
||||||
|
});
|
38
package.json
Normal file
38
package.json
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"name": "@scode/eslint-ts",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "scode eslint typescript configuration",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
|
"test": "echo \"no test\"",
|
||||||
|
"ci": "yarn --frozen-lockfile && node jenkins.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.scode.ovh/timo/eslint-ts.git"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"eslint": ">=6.8.0",
|
||||||
|
"typescript": ">=3.8.0"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"eslint",
|
||||||
|
"eslintconfig"
|
||||||
|
],
|
||||||
|
"author": "Timo Hocker",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^6.8.0",
|
||||||
|
"eslint-config-standard": "^14.1.0",
|
||||||
|
"eslint-plugin-import": "^2.20.2",
|
||||||
|
"eslint-plugin-node": "^11.1.0",
|
||||||
|
"eslint-plugin-promise": "^4.2.1",
|
||||||
|
"eslint-plugin-standard": "^4.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@scode/eslint-es6": "^1.0.1",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^2.26.0",
|
||||||
|
"@typescript-eslint/parser": "^2.26.0"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user