0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

aling eslint config with main branch (#3238)

* chore: update linter tools

* fix: eslint warnings

* fix: eslint warnings

* chore: set max warnings
This commit is contained in:
Juan Picado 2022-06-19 21:26:46 +02:00 committed by GitHub
parent f8df6d2ef9
commit 23b5c1d6ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
101 changed files with 574 additions and 447 deletions

View file

@ -1,3 +1,4 @@
# files
node_modules
coverage/
wiki/
@ -5,10 +6,16 @@ static/
flow-typed/
website/
build/
Dockerfile
test/unit/partials/
types/custom.d.ts
LICENSE
.pnp.js
# extensions
*.md
*.lock
*.yaml
Dockerfile
*.rpi
*.html
*.scss
@ -16,8 +23,3 @@ Dockerfile
*.jpg
*.sh
*.ico
test/unit/partials/
types/custom.d.ts
docker-examples/
LICENSE
.pnp.js

902
.pnp.js generated

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -6,9 +6,9 @@ module.exports = {
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
'prettier',
'plugin:prettier/recommended',
],
plugins: ['import', 'jest'],
plugins: ['import', 'jest', 'prettier'],
env: {
es6: true,
node: true,
@ -23,20 +23,18 @@ module.exports = {
ecmaVersion: 11,
ecmaFeatures: {
impliedStrict: true,
jsx: true,
},
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx'],
extensions: ['.js', '.ts'],
},
},
},
parser: '@typescript-eslint/parser',
rules: {
curly: ['error', 'all'],
'react/prop-types': 0,
'jest/no-export': 0,
'jest/no-test-callback': 0,
'jest/expect-expect': 0,
@ -49,7 +47,6 @@ module.exports = {
'padded-blocks': 'off',
'require-jsdoc': 'off',
'valid-jsdoc': 'off',
'import/order': ['warn'],
'eol-last': 'error',
'no-irregular-whitespace': 'error',
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],

View file

@ -88,7 +88,7 @@
"@commitlint/cli": "12.1.4",
"@commitlint/config-conventional": "12.1.4",
"@octokit/rest": "18.12.0",
"@trivago/prettier-plugin-sort-imports": "3.1.1",
"@trivago/prettier-plugin-sort-imports": "3.2.0",
"@types/async": "3.2.13",
"@types/express": "4.17.13",
"@types/express-rate-limit": "5.1.3",
@ -102,8 +102,8 @@
"@types/pino": "6.3.12",
"@types/request": "2.48.8",
"@types/semver": "7.3.9",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"@typescript-eslint/eslint-plugin": "5.22.0",
"@typescript-eslint/parser": "5.22.0",
"@verdaccio-scope/verdaccio-auth-foo": "0.0.2",
"@verdaccio/eslint-config": "^10.0.0",
"@verdaccio/types": "10.5.1",
@ -116,12 +116,14 @@
"detect-secrets": "1.0.6",
"eslint": "7.32.0",
"eslint-config-google": "0.14.0",
"eslint-config-prettier": "7.2.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-babel": "5.3.1",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "24.7.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "26.1.5",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-simple-import-sort": "7.0.0",
"eslint-plugin-verdaccio": "9.6.1",
"eslint-plugin-verdaccio": "10.0.0",
"fs-extra": "10.1.0",
"husky": "6.0.0",
"jest": "26.6.3",
@ -133,7 +135,7 @@
"nock": "12.0.3",
"node-mocks-http": "^1.10.1",
"pinst": "2.1.6",
"prettier": "2.5.1",
"prettier": "2.6.2",
"puppeteer": "5.5.0",
"rimraf": "3.0.2",
"selfsigned": "1.10.14",
@ -170,7 +172,7 @@
"test:all": "yarn run test && yarn run test:functional && yarn run test:e2e & yarn run test:e2e:pkg",
"pre:ci": "yarn run lint",
"lint": "yarn run type-check && yarn run lint:ts",
"lint:ts": "eslint \"**/*.{js,jsx,ts,tsx}\" -c ./eslintrc.js",
"lint:ts": "eslint \"**/*.{js,jsx,ts}\" --max-warnings 145 -c ./eslintrc.js",
"lint:lockfile": "lockfile-lint --path yarn.lock --type yarn --validate-https --allowed-hosts verdaccio npm yarn",
"start": "yarn babel-node --extensions \".ts,.tsx\" src/lib/cli --inspect",
"start:brk": "yarn babel-node --extensions \".ts,.tsx\" src/lib/cli --inspect-brk",

View file

@ -1,7 +1,3 @@
/**
* @prettier
* @flow
*/
import { Router } from 'express';
import { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../../../../types';

View file

@ -1,7 +1,3 @@
/**
* @prettier
*/
import { Response, Router } from 'express';
import _ from 'lodash';

View file

@ -1,7 +1,3 @@
/**
* @prettier
* @flow
*/
import { Router } from 'express';
import { Package } from '@verdaccio/types';

View file

@ -1,7 +1,4 @@
/**
* @prettier
*/
import express, { Request, Response, Router } from 'express';
import { Request, Response, Router } from 'express';
import _ from 'lodash';
import { Config, JWTSignOptions, RemoteUser } from '@verdaccio/types';

View file

@ -1,7 +1,3 @@
/**
* @prettier
*/
const path = require('path');
const APP_ROOT = path.resolve(__dirname, '../../');

View file

@ -1,6 +1,6 @@
import constants from 'constants';
import { Application } from 'express';
import express from 'express';
import { Application } from 'express';
import fs from 'fs';
import http from 'http';
import https from 'https';

View file

@ -1,7 +1,3 @@
/**
* @prettier
* @flow
*/
import assert from 'assert';
import _ from 'lodash';
import minimatch from 'minimatch';

View file

@ -1,9 +1,3 @@
/**
* @prettier
*/
// @flow
export const DEFAULT_PORT = '4873';
export const DEFAULT_PROTOCOL = 'http';
export const DEFAULT_DOMAIN = 'localhost';

View file

@ -1,7 +1,3 @@
/**
* @prettier
* @flow
*/
import _ from 'lodash';
import semver from 'semver';

View file

@ -5,8 +5,8 @@ import Stream from 'stream';
import { VerdaccioError } from '@verdaccio/commons-api';
import { ReadTarball } from '@verdaccio/streams';
import { GenericBody, Token, TokenFilter } from '@verdaccio/types';
import { Callback, Config, DistFile, IReadTarball, IUploadTarball, Logger, MergeTags, Package, Version, Versions } from '@verdaccio/types';
import { GenericBody, Token, TokenFilter } from '@verdaccio/types';
import { IGetPackageOptions, IPluginFilters, IProxy, IStorage, IStorageHandler, ISyncUplinks, ProxyList, StringValue } from '../../types';
import { logger } from '../lib/logger';

View file

@ -1,10 +1,6 @@
{
"extends": [
"eslint:recommended"
],
"env": {
"node": true,
"mocha": true,
"es6": true,
"browser": true
},
@ -24,10 +20,7 @@
}
],
"no-useless-escape": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-empty-function": 0,
"handle-callback-err": 0,
"import/order": 0,
"prefer-const": 0,
"prefer-promise-reject-errors": 1
}

View file

@ -4,8 +4,8 @@
/* eslint-disable no-unused-vars */
import { IReadTarball, IUploadTarball } from '@verdaccio/streams';
import { Config as AppConfig, IBasicAuth, IPluginMiddleware, IStorageManager, RemoteUser } from '@verdaccio/types';
import { Package } from '@verdaccio/types';
import { Config as AppConfig, IBasicAuth, IPluginMiddleware, IStorageManager, RemoteUser } from '@verdaccio/types';
import Config from '../../../../src/lib/config';
import { generatePackageTemplate } from '../../../../src/lib/storage-utils';

View file

@ -1,41 +1,16 @@
import _ from 'lodash';
import nock from 'nock';
import path from 'path';
import rimraf from 'rimraf';
import { Readable } from 'stream';
import request from 'supertest';
import endPointAPI from '../../../../src/api';
import { API_ERROR, API_MESSAGE, HEADERS, HEADER_TYPE, HTTP_STATUS, TOKEN_BEARER } from '../../../../src/lib/constants';
import { buildToken, encodeScopedUri } from '../../../../src/lib/utils';
import { HEADERS, HEADER_TYPE, HTTP_STATUS } from '../../../../src/lib/constants';
import { DOMAIN_SERVERS } from '../../../functional/config.functional';
import { generateUnPublishURI, getNewToken, getPackage, putPackage, verifyPackageVersionDoesExist } from '../../__helper/api';
import { mockServer } from '../../__helper/mock';
import { generateDeprecateMetadata, generatePackageMetadata, generatePackageUnpublish, generateStarMedatada, generateVersion } from '../../__helper/utils';
import configDefault from '../../partials/config';
import publishMetadata from '../../partials/publish-api';
const sleep = (delay) => {
return new Promise((resolve) => {
setTimeout(resolve, delay);
});
};
require('../../../../src/lib/logger').setup([{ type: 'stdout', format: 'pretty', level: 'debug' }]);
const credentials = { name: 'jota', password: 'secretPass' };
const putVersion = (app, name, publishMetadata) => {
return request(app)
.put(name)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON)
.send(JSON.stringify(publishMetadata))
.expect(HTTP_STATUS.CREATED)
.set('accept', 'gzip')
.set('accept-encoding', HEADERS.JSON)
.set(HEADER_TYPE.CONTENT_TYPE, HEADERS.JSON);
};
describe('endpoint unit test', () => {
let app;
const mockServerPort = 55549;

View file

@ -19,7 +19,6 @@ import { setup } from '../../../../src/lib/logger';
import { buildToken, convertPayloadToBase64, parseConfigFile } from '../../../../src/lib/utils';
import { IAuth } from '../../../../types';
import { parseConfigurationFile } from '../../__helper';
// $FlowFixMe
import configExample from '../../partials/config';
setup([]);

Some files were not shown because too many files have changed in this diff Show more