mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
refactor: fix a few eslint module boundary type overrides (#1542)
This commit is contained in:
parent
3e40cb935e
commit
36922d156d
@ -50,7 +50,6 @@ export default class ArchiveController extends Controller {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
||||||
async getArchivedFeatures(
|
async getArchivedFeatures(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response<FeaturesSchema>,
|
res: Response<FeaturesSchema>,
|
||||||
@ -71,7 +70,6 @@ export default class ArchiveController extends Controller {
|
|||||||
res.status(200).end();
|
res.status(200).end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
||||||
async reviveFeatureToggle(req: IAuthRequest, res: Response): Promise<void> {
|
async reviveFeatureToggle(req: IAuthRequest, res: Response): Promise<void> {
|
||||||
const userName = extractUsername(req);
|
const userName = extractUsername(req);
|
||||||
const { featureName } = req.params;
|
const { featureName } = req.params;
|
||||||
|
@ -2,6 +2,7 @@ import { ADMIN } from '../../types/permissions';
|
|||||||
import { TemplateFormat } from '../../services/email-service';
|
import { TemplateFormat } from '../../services/email-service';
|
||||||
import { IUnleashConfig } from '../../types/option';
|
import { IUnleashConfig } from '../../types/option';
|
||||||
import { IUnleashServices } from '../../types/services';
|
import { IUnleashServices } from '../../types/services';
|
||||||
|
import { Request, Response } from 'express';
|
||||||
|
|
||||||
const Controller = require('../controller');
|
const Controller = require('../controller');
|
||||||
|
|
||||||
@ -17,8 +18,7 @@ export default class EmailController extends Controller {
|
|||||||
this.get('/preview/text/:template', this.getTextPreview, ADMIN);
|
this.get('/preview/text/:template', this.getTextPreview, ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async getHtmlPreview(req: Request, res: Response): Promise<void> {
|
||||||
async getHtmlPreview(req, res): Promise<void> {
|
|
||||||
const { template } = req.params;
|
const { template } = req.params;
|
||||||
const ctx = req.query;
|
const ctx = req.query;
|
||||||
const data = await this.emailService.compileTemplate(
|
const data = await this.emailService.compileTemplate(
|
||||||
@ -32,8 +32,7 @@ export default class EmailController extends Controller {
|
|||||||
res.end();
|
res.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async getTextPreview(req: Request, res: Response): Promise<void> {
|
||||||
async getTextPreview(req, res) {
|
|
||||||
const { template } = req.params;
|
const { template } = req.params;
|
||||||
const ctx = req.query;
|
const ctx = req.query;
|
||||||
const data = await this.emailService.compileTemplate(
|
const data = await this.emailService.compileTemplate(
|
||||||
|
@ -12,6 +12,8 @@ import {
|
|||||||
CREATE_STRATEGY,
|
CREATE_STRATEGY,
|
||||||
UPDATE_STRATEGY,
|
UPDATE_STRATEGY,
|
||||||
} from '../../types/permissions';
|
} from '../../types/permissions';
|
||||||
|
import { Request, Response } from 'express';
|
||||||
|
import { IAuthRequest } from '../unleash-types';
|
||||||
|
|
||||||
const version = 1;
|
const version = 1;
|
||||||
|
|
||||||
@ -45,8 +47,7 @@ class StrategyController extends Controller {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async getAllStrategies(req: Request, res: Response): Promise<void> {
|
||||||
async getAllStrategies(req, res): Promise<void> {
|
|
||||||
try {
|
try {
|
||||||
const strategies = await this.strategyService.getStrategies();
|
const strategies = await this.strategyService.getStrategies();
|
||||||
res.json({ version, strategies });
|
res.json({ version, strategies });
|
||||||
@ -55,8 +56,7 @@ class StrategyController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async getStrategy(req: Request, res: Response): Promise<void> {
|
||||||
async getStrategy(req, res): Promise<void> {
|
|
||||||
try {
|
try {
|
||||||
const { name } = req.params;
|
const { name } = req.params;
|
||||||
const strategy = await this.strategyService.getStrategy(name);
|
const strategy = await this.strategyService.getStrategy(name);
|
||||||
@ -66,8 +66,7 @@ class StrategyController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async removeStrategy(req: IAuthRequest, res: Response): Promise<void> {
|
||||||
async removeStrategy(req, res): Promise<void> {
|
|
||||||
const strategyName = req.params.name;
|
const strategyName = req.params.name;
|
||||||
const userName = extractUsername(req);
|
const userName = extractUsername(req);
|
||||||
|
|
||||||
@ -79,8 +78,7 @@ class StrategyController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async createStrategy(req: IAuthRequest, res: Response): Promise<void> {
|
||||||
async createStrategy(req, res): Promise<void> {
|
|
||||||
const userName = extractUsername(req);
|
const userName = extractUsername(req);
|
||||||
try {
|
try {
|
||||||
await this.strategyService.createStrategy(req.body, userName);
|
await this.strategyService.createStrategy(req.body, userName);
|
||||||
@ -90,8 +88,7 @@ class StrategyController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async updateStrategy(req: IAuthRequest, res: Response): Promise<void> {
|
||||||
async updateStrategy(req, res): Promise<void> {
|
|
||||||
const userName = extractUsername(req);
|
const userName = extractUsername(req);
|
||||||
try {
|
try {
|
||||||
await this.strategyService.updateStrategy(req.body, userName);
|
await this.strategyService.updateStrategy(req.body, userName);
|
||||||
@ -101,8 +98,7 @@ class StrategyController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async deprecateStrategy(req: IAuthRequest, res: Response): Promise<void> {
|
||||||
async deprecateStrategy(req, res): Promise<void> {
|
|
||||||
const userName = extractUsername(req);
|
const userName = extractUsername(req);
|
||||||
const { strategyName } = req.params;
|
const { strategyName } = req.params;
|
||||||
if (strategyName === 'default') {
|
if (strategyName === 'default') {
|
||||||
@ -120,8 +116,7 @@ class StrategyController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
async reactivateStrategy(req: IAuthRequest, res: Response): Promise<void> {
|
||||||
async reactivateStrategy(req, res): Promise<void> {
|
|
||||||
const userName = extractUsername(req);
|
const userName = extractUsername(req);
|
||||||
const { strategyName } = req.params;
|
const { strategyName } = req.params;
|
||||||
try {
|
try {
|
||||||
|
@ -118,7 +118,6 @@ async function createApp(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
||||||
async function start(opts: IUnleashOptions = {}): Promise<IUnleash> {
|
async function start(opts: IUnleashOptions = {}): Promise<IUnleash> {
|
||||||
const config = createConfig(opts);
|
const config = createConfig(opts);
|
||||||
const logger = config.getLogger('server-impl.js');
|
const logger = config.getLogger('server-impl.js');
|
||||||
@ -143,7 +142,6 @@ async function start(opts: IUnleashOptions = {}): Promise<IUnleash> {
|
|||||||
return unleash;
|
return unleash;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
||||||
async function create(opts: IUnleashOptions): Promise<IUnleash> {
|
async function create(opts: IUnleashOptions): Promise<IUnleash> {
|
||||||
const config = createConfig(opts);
|
const config = createConfig(opts);
|
||||||
const logger = config.getLogger('server-impl.js');
|
const logger = config.getLogger('server-impl.js');
|
||||||
|
@ -646,7 +646,6 @@ export default class StateService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
||||||
async export({
|
async export({
|
||||||
includeFeatureToggles = true,
|
includeFeatureToggles = true,
|
||||||
includeStrategies = true,
|
includeStrategies = true,
|
||||||
|
Loading…
Reference in New Issue
Block a user