chore: update eslint config (#13237)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
This commit is contained in:
Родитель
6c953ead4e
Коммит
12a7b9b13d
|
@ -11,6 +11,7 @@ coverage
|
|||
**/*.d.ts
|
||||
/config.js
|
||||
.clinic/
|
||||
.cache/
|
||||
|
||||
# generated code
|
||||
**/*.generated.ts
|
||||
|
|
17
.eslintrc.js
17
.eslintrc.js
|
@ -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);
|
||||
})();
|
|
@ -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"]
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче