Skip to content

Commit 874d8ef

Browse files
committed
Fix ESLint issues for the rest of core-build/*
1 parent 81b08b2 commit 874d8ef

36 files changed

+132
-98
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require("@rushstack/eslint-config/patch-eslint6");
3+
4+
module.exports = {
5+
extends: [ "@rushstack/eslint-config" ],
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
};

core-build/gulp-core-build-mocha/src/InstrumentTask.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface IInstrumentTaskConfig {
1010
}
1111

1212
export class InstrumentTask extends GulpTask<IInstrumentTaskConfig> {
13-
constructor() {
13+
public constructor() {
1414
super(
1515
'instrument',
1616
{
@@ -27,6 +27,7 @@ export class InstrumentTask extends GulpTask<IInstrumentTaskConfig> {
2727
}
2828

2929
public executeTask(gulp: typeof Gulp, completeCallback?: (error?: string) => void): NodeJS.ReadWriteStream {
30+
// eslint-disable-next-line @typescript-eslint/no-var-requires
3031
const istanbul: typeof gulpIstanbul = require('gulp-istanbul');
3132

3233
return gulp.src(this.taskConfig.coverageMatch)

core-build/gulp-core-build-mocha/src/MochaTask.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface IMochaTaskConfig {
1313
}
1414

1515
export class MochaTask extends GulpTask<IMochaTaskConfig> {
16-
constructor() {
16+
public constructor() {
1717
super(
1818
'mocha',
1919
{
@@ -33,7 +33,9 @@ export class MochaTask extends GulpTask<IMochaTaskConfig> {
3333
public executeTask(gulp: typeof Gulp, completeCallback: (error?: string) => void): NodeJS.ReadWriteStream
3434
| Promise<void> {
3535

36+
// eslint-disable-next-line @typescript-eslint/no-var-requires
3637
const istanbul: typeof gulpIstanbul = require('gulp-istanbul');
38+
// eslint-disable-next-line @typescript-eslint/no-var-requires
3739
const mocha: typeof gulpMocha = require('gulp-mocha');
3840

3941
const globPattern: string = this.taskConfig.testMatch.join('|');
@@ -43,9 +45,8 @@ export class MochaTask extends GulpTask<IMochaTaskConfig> {
4345
return Promise.resolve();
4446
}
4547

46-
/* tslint:disable:no-string-literal */
48+
// eslint-disable-next-line dot-notation
4749
const matchString: string = this.buildConfig.args['match'] as string;
48-
/* tslint:enable:no-string-literal */
4950

5051
return gulp.src(this.taskConfig.testMatch, { read: false })
5152
.pipe(

core-build/gulp-core-build-mocha/tslint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require("@rushstack/eslint-config/patch-eslint6");
3+
4+
module.exports = {
5+
extends: [ "@rushstack/eslint-config" ],
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
};

core-build/gulp-core-build-sass/src/CSSModules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class CSSModules implements ICSSModules {
3333
* That is used in {@link ./SassTask#SassTask}
3434
* But will default the process' current working dir.
3535
*/
36-
constructor(rootPath?: string) {
36+
public constructor(rootPath?: string) {
3737
this._classMap = {};
3838
if (rootPath) {
3939
this._rootPath = rootPath;

core-build/gulp-core-build-sass/src/SassTask.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { splitStyles } from '@microsoft/load-themed-styles';
1010
import {
1111
FileSystem,
1212
JsonFile,
13-
LegacyAdapters
13+
LegacyAdapters,
14+
JsonObject
1415
} from '@microsoft/node-core-library';
1516
import * as glob from 'glob';
1617
import * as nodeSass from 'node-sass';
@@ -89,7 +90,7 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
8990
autoprefixer({ browsers: ['> 1%', 'last 2 versions', 'ie >= 10'] })
9091
];
9192

92-
constructor() {
93+
public constructor() {
9394
super(
9495
'sass',
9596
{
@@ -107,7 +108,7 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
107108
);
108109
}
109110

110-
public loadSchema(): Object {
111+
public loadSchema(): JsonObject {
111112
return JsonFile.load(path.join(__dirname, 'sass.schema.json'));
112113
}
113114

@@ -182,7 +183,7 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
182183
return postcss(plugins).process(result.css.toString(), options) as PromiseLike<postcss.Result>;
183184
}).then((result: postcss.Result) => {
184185
let cleanCssOptions: CleanCss.Options = { level: 1, returnPromise: true };
185-
if (!!this.taskConfig.cleanCssOptions) {
186+
if (this.taskConfig.cleanCssOptions) {
186187
cleanCssOptions = { ...this.taskConfig.cleanCssOptions, returnPromise: true };
187188
}
188189
cleanCssOptions.sourceMap = !!result.map;
@@ -221,7 +222,7 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
221222
`require(${JSON.stringify(`./${path.basename(cssOutputPathAbsolute)}`)});`,
222223
stylesExportString
223224
]);
224-
} else if (!!content) {
225+
} else if (content) {
225226
lines = lines.concat([
226227
'import { loadStyles } from \'@microsoft/load-themed-styles\';',
227228
'',
@@ -295,7 +296,7 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
295296

296297
if (this.taskConfig.moduleExportName === '') {
297298
exportString = 'export = styles;';
298-
} else if (!!this.taskConfig.moduleExportName) {
299+
} else if (this.taskConfig.moduleExportName) {
299300
// exportString = `export const ${this.taskConfig.moduleExportName} = styles;`;
300301
}
301302

core-build/gulp-core-build-sass/tslint.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This is a workaround for https://github.com/eslint/eslint/issues/3458
2+
require("@rushstack/eslint-config/patch-eslint6");
3+
4+
module.exports = {
5+
extends: [ "@rushstack/eslint-config" ],
6+
parserOptions: { tsconfigRootDir: __dirname },
7+
};

core-build/gulp-core-build-serve/src/NodeForgeExtensions.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ interface IAttr {
77
}
88

99
interface IForgeCertificate {
10-
publicKey: any; // tslint:disable-line:no-any
10+
publicKey: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1111

1212
validity: {
1313
notBefore: Date;
@@ -20,11 +20,11 @@ interface IForgeCertificate {
2020

2121
setIssuer(attrs: IAttr[]): void;
2222

23-
setExtensions(extensions: any[]): void; // tslint:disable-line:no-any
23+
setExtensions(extensions: any[]): void; // eslint-disable-line @typescript-eslint/no-explicit-any
2424

25-
getExtension(extensionName: string): any; // tslint:disable-line:no-any
25+
getExtension(extensionName: string): any; // eslint-disable-line @typescript-eslint/no-explicit-any
2626

27-
sign(privateKey: string, algorithm: IForgeSignatureAlgorithm): void; // tslint:disable-line:no-any
27+
sign(privateKey: string, algorithm: IForgeSignatureAlgorithm): void; // eslint-disable-line @typescript-eslint/no-explicit-any
2828
}
2929

3030
interface IForgeSignatureAlgorithm {

0 commit comments

Comments
 (0)