This commit is contained in:
2020-05-07 18:40:35 +02:00
parent ab66113c89
commit c25b352041
32 changed files with 124 additions and 138 deletions

View File

@ -1,3 +1,10 @@
/*
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
const eslintrc = `module.exports = {
env: {
commonjs: true,
@ -5,7 +12,7 @@ const eslintrc = `module.exports = {
node: true
},
extends: [
'@scode'
'@sapphirecode'
],
globals: {
Atomics: 'readonly',
@ -24,7 +31,7 @@ const eslintrc_ts = `module.exports = {
node: true
},
extends: [
'@scode/eslint-config-ts'
'@sapphirecode/eslint-config-ts'
],
globals: {
Atomics: 'readonly',
@ -42,9 +49,6 @@ const gitignore = `/node_modules/
/coverage/
`;
const npmrc = `@scode:registry=https://npm.scode.ovh
`;
const tsconfig = `{
"compilerOptions": {
"target": "es5",
@ -63,4 +67,4 @@ const eslintignore = `/dist/
*.d.ts
`;
export { eslintrc, gitignore, npmrc, tsconfig, eslintrc_ts, eslintignore };
export { eslintrc, gitignore, tsconfig, eslintrc_ts, eslintignore };

View File

@ -2,7 +2,7 @@
* Copyright (C) SapphireCode - All Rights Reserved
* This file is part of Snippeteer which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, April 2020
* Created by Timo Hocker <timo@scode.ovh>, May 2020
*/
import path from 'path';
@ -12,7 +12,7 @@ import { Snippet } from '../../Snippet';
import { apply_template, modify_json, run_command } from '../../Helper';
import {
eslintrc, gitignore, npmrc,
eslintrc, gitignore,
tsconfig, eslintrc_ts, eslintignore
} from './Assets';
@ -75,7 +75,6 @@ export default class Node implements Snippet {
.run ();
await apply_template (eslintrc, path.join (folder, '.eslintrc.js'));
await apply_template (npmrc, path.join (folder, '.npmrc'));
await apply_template (gitignore, path.join (folder, '.gitignore'));
await apply_template (
eslintignore,
@ -91,7 +90,7 @@ export default class Node implements Snippet {
run_command ('git init', folder);
run_command ('yarn init -y', folder);
run_command (
`yarn add --dev @scode/eslint-config${use_ts
`yarn add --dev @sapphirecode/eslint-config${use_ts
? '-ts typescript @ava/typescript'
: ''} eslint nyc ava`,
folder