Co-authored-by: Rhys Arkins <rhys@arkins.net>
This commit is contained in:
Michael Kriese 2021-12-22 14:31:14 +01:00 коммит произвёл GitHub
Родитель 6c953ead4e
Коммит 12a7b9b13d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 35 добавлений и 24 удалений

Просмотреть файл

@ -11,6 +11,7 @@ coverage
**/*.d.ts
/config.js
.clinic/
.cache/
# generated code
**/*.generated.ts

Просмотреть файл

@ -28,10 +28,11 @@ module.exports = {
* checks done by typescript.
*
* https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
* required for esm check
*/
'import/default': 0,
'import/named': 0,
'import/namespace': 0,
'import/default': 2,
'import/named': 2,
'import/namespace': 2,
'import/no-named-as-default-member': 0,
'import/prefer-default-export': 0, // no benefit
@ -120,6 +121,10 @@ module.exports = {
},
},
overrides: [
{
// files to check, so no `--ext` is required
files: ['**/*.{js,mjs,cjs,ts}'],
},
{
files: ['**/*.spec.ts', 'test/**'],
env: {
@ -143,7 +148,7 @@ module.exports = {
},
},
{
files: ['**/*.{js,mjs}'],
files: ['**/*.{js,mjs,cjs}'],
rules: {
'@typescript-eslint/explicit-function-return-type': 0,
@ -152,7 +157,7 @@ module.exports = {
},
},
{
files: ['tools/**/*.{ts,js,mjs}'],
files: ['tools/**/*.{ts,js,mjs,cjs}'],
env: {
node: true,
},
@ -164,7 +169,7 @@ module.exports = {
},
},
{
files: ['tools/**/*.js'],
files: ['tools/**/*.{js,cjs}', 'bin/*.{js,cjs}'],
rules: {
// need commonjs
'@typescript-eslint/no-var-requires': 'off',

Просмотреть файл

@ -1,10 +0,0 @@
const fs = require('fs-extra');
const os = require('os');
const path = require('path');
(async () => {
const tmpDir = process.env.RENOVATE_TMPDIR || os.tmpdir();
const renovateDir = path.join(tmpDir, 'renovate');
console.log('Removing ' + renovateDir);
await fs.remove(renovateDir);
})();

12
bin/clean-cache.mjs Normal file
Просмотреть файл

@ -0,0 +1,12 @@
import { tmpdir } from 'os';
import { join } from 'path';
import { remove } from 'fs-extra';
// eslint-disable-next-line @typescript-eslint/no-floating-promises
(async () => {
const tmpDir = process.env.RENOVATE_TMPDIR || tmpdir();
const renovateDir = join(tmpDir, 'renovate');
// eslint-disable-next-line no-console
console.log('Removing ' + renovateDir);
await remove(renovateDir);
})();

Просмотреть файл

@ -10,8 +10,12 @@ const schema = {
};
const options = getOptions();
options.sort((a, b) => {
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
});
const properties = {};
@ -34,7 +38,7 @@ function createSingleConfig(option) {
temp.items.enum = option.allowedValues;
}
}
if (option.subType == 'string' && option.allowString === true) {
if (option.subType === 'string' && option.allowString === true) {
const items = temp.items;
delete temp.items;
delete temp.type;

Просмотреть файл

@ -10,15 +10,15 @@
"build": "run-s clean generate:* compile:*",
"build:docs": "run-s \"release:prepare {@}\"",
"clean": "rimraf dist tmp",
"clean-cache": "node bin/clean-cache.js",
"clean-cache": "node bin/clean-cache.mjs",
"compile:ts": "tsc -p tsconfig.app.json",
"config-validator": "node -r ts-node/register/transpile-only -- lib/config-validator.ts",
"create-json-schema": "node -r ts-node/register/transpile-only -- bin/create-json-schema.js && prettier --write \"renovate-schema.json\"",
"debug": "node --inspect-brk -r ts-node/register/transpile-only -- lib/renovate.ts",
"doc-fix": "run-s markdown-lint-fix prettier-fix",
"doc-fence-check": "node tools/check-fenced-code.mjs",
"eslint": "eslint --ext .js,.mjs,.ts lib/ test/ tools/ --report-unused-disable-directives",
"eslint-fix": "eslint --ext .js,.mjs,.ts --fix lib/ test/ tools/ --report-unused-disable-directives",
"eslint": "eslint . --report-unused-disable-directives",
"eslint-fix": "eslint --fix . --report-unused-disable-directives",
"generate": "run-s generate:*",
"generate:imports": "node tools/generate-imports.mjs",
"git-check": "node tools/check-git-version.mjs",

Просмотреть файл

@ -26,7 +26,6 @@
"./.cache",
"./dist",
"**/__mocks__/*",
"bin",
"coverage",
"config.js",
"tmp"

Просмотреть файл

@ -1,4 +1,4 @@
{
"extends": "./tsconfig",
"include": [".eslintrc.js", "**/*.ts", "**/*.js", "**/*.mjs"]
"include": [".eslintrc.js", "**/*.ts", "**/*.js", "**/*.mjs", "**/*.cjs"]
}