diff --git a/packages/opentelemetry-basic-tracer/package.json b/packages/opentelemetry-basic-tracer/package.json index 4134926dac3..3289aee070c 100644 --- a/packages/opentelemetry-basic-tracer/package.json +++ b/packages/opentelemetry-basic-tracer/package.json @@ -45,6 +45,7 @@ "mocha": "^6.1.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.0.0", "typescript": "^3.4.5" diff --git a/packages/opentelemetry-basic-tracer/src/export/ExportResult.ts b/packages/opentelemetry-basic-tracer/src/export/ExportResult.ts index 7f0979bada1..3f94eddd57b 100644 --- a/packages/opentelemetry-basic-tracer/src/export/ExportResult.ts +++ b/packages/opentelemetry-basic-tracer/src/export/ExportResult.ts @@ -15,7 +15,7 @@ */ export enum ExportResult { - Success, - FailedNotRetryable, - FailedRetryable, + SUCCESS, + FAILED_NOT_RETRYABLE, + FAILED_RETRYABLE, } diff --git a/packages/opentelemetry-basic-tracer/src/export/InMemorySpanExporter.ts b/packages/opentelemetry-basic-tracer/src/export/InMemorySpanExporter.ts index adfcf3f77c6..1a8f8c5aee9 100644 --- a/packages/opentelemetry-basic-tracer/src/export/InMemorySpanExporter.ts +++ b/packages/opentelemetry-basic-tracer/src/export/InMemorySpanExporter.ts @@ -31,9 +31,9 @@ export class InMemorySpanExporter implements SpanExporter { spans: ReadableSpan[], resultCallback: (result: ExportResult) => void ): void { - if (this._stopped) return resultCallback(ExportResult.FailedNotRetryable); + if (this._stopped) return resultCallback(ExportResult.FAILED_NOT_RETRYABLE); this._finishedSpans.push(...spans); - return resultCallback(ExportResult.Success); + return resultCallback(ExportResult.SUCCESS); } shutdown(): void { diff --git a/packages/opentelemetry-basic-tracer/test/export/InMemorySpanExporter.test.ts b/packages/opentelemetry-basic-tracer/test/export/InMemorySpanExporter.test.ts index 910b63234b7..456f617d523 100644 --- a/packages/opentelemetry-basic-tracer/test/export/InMemorySpanExporter.test.ts +++ b/packages/opentelemetry-basic-tracer/test/export/InMemorySpanExporter.test.ts @@ -71,7 +71,7 @@ describe('InMemorySpanExporter', () => { it('should return the success result', () => { const exorter = new InMemorySpanExporter(); exorter.export([], (result: ExportResult) => { - assert.strictEqual(result, ExportResult.Success); + assert.strictEqual(result, ExportResult.SUCCESS); }); }); @@ -81,7 +81,7 @@ describe('InMemorySpanExporter', () => { // after shutdown export should fail exorter.export([], (result: ExportResult) => { - assert.strictEqual(result, ExportResult.FailedNotRetryable); + assert.strictEqual(result, ExportResult.FAILED_NOT_RETRYABLE); }); }); }); diff --git a/packages/opentelemetry-basic-tracer/tslint.json b/packages/opentelemetry-basic-tracer/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-basic-tracer/tslint.json +++ b/packages/opentelemetry-basic-tracer/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-core/package.json b/packages/opentelemetry-core/package.json index 3cec22a7288..1fb7089a0fa 100644 --- a/packages/opentelemetry-core/package.json +++ b/packages/opentelemetry-core/package.json @@ -57,6 +57,7 @@ "mocha": "^6.1.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-loader": "^6.0.4", "ts-mocha": "^6.0.0", "ts-node": "^8.0.0", diff --git a/packages/opentelemetry-core/src/trace/TracerDelegate.ts b/packages/opentelemetry-core/src/trace/TracerDelegate.ts index cafc0e3df4c..625d20106e2 100644 --- a/packages/opentelemetry-core/src/trace/TracerDelegate.ts +++ b/packages/opentelemetry-core/src/trace/TracerDelegate.ts @@ -29,20 +29,20 @@ export class TracerDelegate implements types.Tracer { // Wrap a tracer with a TracerDelegate. Provided tracer becomes the default // fallback tracer for when a global tracer has not been initialized constructor( - private readonly tracer: types.Tracer | null = null, - private readonly fallbackTracer: types.Tracer = new NoopTracer() + private readonly _tracer: types.Tracer | null = null, + private readonly _fallbackTracer: types.Tracer = new NoopTracer() ) { - this._currentTracer = tracer || fallbackTracer; // equivalent to this.start() + this._currentTracer = _tracer || _fallbackTracer; // equivalent to this.start() } // Begin using the user provided tracer. Stop always falling back to fallback tracer start(): void { - this._currentTracer = this.tracer || this.fallbackTracer; + this._currentTracer = this._tracer || this._fallbackTracer; } // Stop the delegate from using the provided tracer. Begin to use the fallback tracer stop(): void { - this._currentTracer = this.fallbackTracer; + this._currentTracer = this._fallbackTracer; } // -- Tracer interface implementation below -- // diff --git a/packages/opentelemetry-core/tslint.json b/packages/opentelemetry-core/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-core/tslint.json +++ b/packages/opentelemetry-core/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-exporter-jaeger/package.json b/packages/opentelemetry-exporter-jaeger/package.json index 5d40b0ff5cd..4f3100a78eb 100644 --- a/packages/opentelemetry-exporter-jaeger/package.json +++ b/packages/opentelemetry-exporter-jaeger/package.json @@ -43,6 +43,7 @@ "mocha": "^6.2.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.3.0", "typescript": "^3.5.3" diff --git a/packages/opentelemetry-exporter-jaeger/src/jaeger.ts b/packages/opentelemetry-exporter-jaeger/src/jaeger.ts index 9f7eccc9258..55b28ba23ed 100644 --- a/packages/opentelemetry-exporter-jaeger/src/jaeger.ts +++ b/packages/opentelemetry-exporter-jaeger/src/jaeger.ts @@ -69,13 +69,13 @@ export class JaegerExporter implements SpanExporter { if (err) { // @todo: decide whether to break out the loop on first error. this._logger.error(`failed to append span: ${err}`); - if (done) return done(ExportResult.FailedNotRetryable); + if (done) return done(ExportResult.FAILED_NOT_RETRYABLE); } }); } // @todo: We should wait for all the callbacks of the append calls to // complete before it calls done with success. this._logger.debug('successful append for : %s', thriftSpan.length); - if (done) return done(ExportResult.Success); + if (done) return done(ExportResult.SUCCESS); } } diff --git a/packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts b/packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts index 9f48d6e8a15..d295690ce34 100644 --- a/packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts +++ b/packages/opentelemetry-exporter-jaeger/test/jaeger.test.ts @@ -66,7 +66,7 @@ describe('JaegerExporter', () => { it('should skip send with empty list', () => { exporter.export([], (result: ExportResult) => { - assert.strictEqual(result, ExportResult.Success); + assert.strictEqual(result, ExportResult.SUCCESS); }); }); @@ -90,7 +90,7 @@ describe('JaegerExporter', () => { }; exporter.export([readableSpan], (result: ExportResult) => { - assert.strictEqual(result, ExportResult.Success); + assert.strictEqual(result, ExportResult.SUCCESS); }); }); }); diff --git a/packages/opentelemetry-exporter-jaeger/tslint.json b/packages/opentelemetry-exporter-jaeger/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-exporter-jaeger/tslint.json +++ b/packages/opentelemetry-exporter-jaeger/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-exporter-zipkin/package.json b/packages/opentelemetry-exporter-zipkin/package.json index bb9000638f5..610acda1796 100644 --- a/packages/opentelemetry-exporter-zipkin/package.json +++ b/packages/opentelemetry-exporter-zipkin/package.json @@ -41,6 +41,7 @@ "mocha": "^6.2.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.3.0", "typescript": "^3.5.3" diff --git a/packages/opentelemetry-exporter-zipkin/tslint.json b/packages/opentelemetry-exporter-zipkin/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-exporter-zipkin/tslint.json +++ b/packages/opentelemetry-exporter-zipkin/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-node-tracer/package.json b/packages/opentelemetry-node-tracer/package.json index a7f79446270..92f439d916b 100644 --- a/packages/opentelemetry-node-tracer/package.json +++ b/packages/opentelemetry-node-tracer/package.json @@ -48,6 +48,7 @@ "nyc": "^14.1.1", "shimmer": "^1.2.0", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.0.0", "typescript": "^3.4.5" diff --git a/packages/opentelemetry-node-tracer/tslint.json b/packages/opentelemetry-node-tracer/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-node-tracer/tslint.json +++ b/packages/opentelemetry-node-tracer/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-plugin-grpc/package.json b/packages/opentelemetry-plugin-grpc/package.json index 00cd6f2c22f..e6a6d24a51f 100644 --- a/packages/opentelemetry-plugin-grpc/package.json +++ b/packages/opentelemetry-plugin-grpc/package.json @@ -47,6 +47,7 @@ "mocha": "^6.2.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.3.0", "typescript": "^3.5.3" diff --git a/packages/opentelemetry-plugin-grpc/src/grpc.ts b/packages/opentelemetry-plugin-grpc/src/grpc.ts index 95a821aef05..266be7b67d8 100644 --- a/packages/opentelemetry-plugin-grpc/src/grpc.ts +++ b/packages/opentelemetry-plugin-grpc/src/grpc.ts @@ -65,8 +65,8 @@ export class GrpcPlugin extends BasePlugin { // TODO: Delete if moving internal file loaders to BasePlugin // --- Note: Incorrectly ordered: Begin internal file loader --- // // tslint:disable-next-line:no-any - protected internalFilesExports: { [key: string]: any } | undefined; - protected readonly internalFileList: ModuleExportsMapping = { + protected _internalFilesExports: { [key: string]: any } | undefined; + protected readonly _internalFileList: ModuleExportsMapping = { '0.13 - 1.6': { client: 'src/node/src/client.js' }, '^1.7': { client: 'src/client.js' }, }; @@ -76,9 +76,9 @@ export class GrpcPlugin extends BasePlugin { */ private _loadInternalFiles(): ModuleExportsMapping { let result: ModuleExportsMapping = {}; - if (this.internalFileList) { - this._logger.debug('loadInternalFiles %o', this.internalFileList); - Object.keys(this.internalFileList).forEach(versionRange => { + if (this._internalFileList) { + this._logger.debug('loadInternalFiles %o', this._internalFileList); + Object.keys(this._internalFileList).forEach(versionRange => { if (semver.satisfies(this.version, versionRange)) { if (result) { this._logger.warn( @@ -86,11 +86,11 @@ export class GrpcPlugin extends BasePlugin { this.moduleName, this.version, versionRange, - this.internalFileList + this._internalFileList ); } result = this._loadInternalModuleFiles( - this.internalFileList[versionRange], + this._internalFileList[versionRange], basedir ); } @@ -137,8 +137,8 @@ export class GrpcPlugin extends BasePlugin { // --- End of internal file loader stuff --- // protected patch(): typeof grpcModule { - if (!this.internalFilesExports) { - this.internalFilesExports = this._loadInternalFiles(); + if (!this._internalFilesExports) { + this._internalFilesExports = this._loadInternalFiles(); } this._logger.debug( 'applying patch to %s@%s', @@ -155,8 +155,8 @@ export class GrpcPlugin extends BasePlugin { ); } - if (this.internalFilesExports && this.internalFilesExports['client']) { - grpcClientModule = this.internalFilesExports['client']; + if (this._internalFilesExports && this._internalFilesExports['client']) { + grpcClientModule = this._internalFilesExports['client']; shimmer.wrap( grpcClientModule, diff --git a/packages/opentelemetry-plugin-grpc/tslint.json b/packages/opentelemetry-plugin-grpc/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-plugin-grpc/tslint.json +++ b/packages/opentelemetry-plugin-grpc/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-plugin-http/package.json b/packages/opentelemetry-plugin-http/package.json index 19b13b494b3..fff71c80400 100644 --- a/packages/opentelemetry-plugin-http/package.json +++ b/packages/opentelemetry-plugin-http/package.json @@ -61,6 +61,7 @@ "nyc": "^14.1.1", "sinon": "^7.3.2", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.3.0", "typescript": "^3.5.3" diff --git a/packages/opentelemetry-plugin-http/tslint.json b/packages/opentelemetry-plugin-http/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-plugin-http/tslint.json +++ b/packages/opentelemetry-plugin-http/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-plugin-http2/package.json b/packages/opentelemetry-plugin-http2/package.json index 1f3f025a4ab..384314c3246 100644 --- a/packages/opentelemetry-plugin-http2/package.json +++ b/packages/opentelemetry-plugin-http2/package.json @@ -45,6 +45,7 @@ "mocha": "^6.2.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.3.0", "typescript": "^3.5.3" diff --git a/packages/opentelemetry-plugin-http2/tslint.json b/packages/opentelemetry-plugin-http2/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-plugin-http2/tslint.json +++ b/packages/opentelemetry-plugin-http2/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-plugin-https/package.json b/packages/opentelemetry-plugin-https/package.json index dc8c027e1c7..83d31389ced 100644 --- a/packages/opentelemetry-plugin-https/package.json +++ b/packages/opentelemetry-plugin-https/package.json @@ -45,6 +45,7 @@ "mocha": "^6.2.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.3.0", "typescript": "^3.5.3" diff --git a/packages/opentelemetry-plugin-https/tslint.json b/packages/opentelemetry-plugin-https/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-plugin-https/tslint.json +++ b/packages/opentelemetry-plugin-https/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-plugin-mongodb/package.json b/packages/opentelemetry-plugin-mongodb/package.json index 9e92e351067..1776e802bf4 100644 --- a/packages/opentelemetry-plugin-mongodb/package.json +++ b/packages/opentelemetry-plugin-mongodb/package.json @@ -45,6 +45,7 @@ "mocha": "^6.2.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.3.0", "typescript": "^3.5.3" diff --git a/packages/opentelemetry-plugin-mongodb/tslint.json b/packages/opentelemetry-plugin-mongodb/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-plugin-mongodb/tslint.json +++ b/packages/opentelemetry-plugin-mongodb/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-plugin-redis/package.json b/packages/opentelemetry-plugin-redis/package.json index f0ac2125b41..066a63a5147 100644 --- a/packages/opentelemetry-plugin-redis/package.json +++ b/packages/opentelemetry-plugin-redis/package.json @@ -45,6 +45,7 @@ "mocha": "^6.2.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.3.0", "typescript": "^3.5.3" diff --git a/packages/opentelemetry-plugin-redis/tslint.json b/packages/opentelemetry-plugin-redis/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-plugin-redis/tslint.json +++ b/packages/opentelemetry-plugin-redis/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-scope-async-hooks/package.json b/packages/opentelemetry-scope-async-hooks/package.json index ee0f52577a6..a0dc1fb21c4 100644 --- a/packages/opentelemetry-scope-async-hooks/package.json +++ b/packages/opentelemetry-scope-async-hooks/package.json @@ -46,6 +46,7 @@ "mocha": "^6.1.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.0.0", "typescript": "^3.4.5" diff --git a/packages/opentelemetry-scope-async-hooks/tslint.json b/packages/opentelemetry-scope-async-hooks/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-scope-async-hooks/tslint.json +++ b/packages/opentelemetry-scope-async-hooks/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-scope-base/package.json b/packages/opentelemetry-scope-base/package.json index a28d9cca47d..e68d6fee1f2 100644 --- a/packages/opentelemetry-scope-base/package.json +++ b/packages/opentelemetry-scope-base/package.json @@ -45,6 +45,7 @@ "mocha": "^6.1.0", "nyc": "^14.1.1", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "ts-mocha": "^6.0.0", "ts-node": "^8.0.0", "typescript": "^3.4.5" diff --git a/packages/opentelemetry-scope-base/tslint.json b/packages/opentelemetry-scope-base/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-scope-base/tslint.json +++ b/packages/opentelemetry-scope-base/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/packages/opentelemetry-types/package.json b/packages/opentelemetry-types/package.json index c9871f290ae..daa62b1c4fa 100644 --- a/packages/opentelemetry-types/package.json +++ b/packages/opentelemetry-types/package.json @@ -42,6 +42,7 @@ "gts": "^1.0.0", "linkinator": "^1.5.0", "tslint-microsoft-contrib": "^6.2.0", + "tslint-consistent-codestyle":"^1.15.1", "typedoc": "^0.14.2", "typescript": "^3.4.5" } diff --git a/packages/opentelemetry-types/tslint.json b/packages/opentelemetry-types/tslint.json index e882e364523..0710b135d07 100644 --- a/packages/opentelemetry-types/tslint.json +++ b/packages/opentelemetry-types/tslint.json @@ -1,4 +1,4 @@ { "rulesDirectory": ["node_modules/tslint-microsoft-contrib"], - "extends": "../../tslint.base.js" + "extends": ["../../tslint.base.js", "./node_modules/tslint-consistent-codestyle"] } diff --git a/tslint.base.js b/tslint.base.js index b281626b28a..32bfefc220e 100644 --- a/tslint.base.js +++ b/tslint.base.js @@ -33,13 +33,13 @@ See the License for the specific language governing permissions and limitations under the License.`; const fileHeaderRegexStr = - fileHeaderTemplate - .replace(/[\\\/^$.*+?()[\]{}|]/g, '\\$&') // Escape regex - .replace(/\n/g, '\n \\* ?') // Per line space+asterisk, optional space - .replace('YEAR_PLACEHOLDER', '2\\d{3}'); + fileHeaderTemplate + .replace(/[\\\/^$.*+?()[\]{}|]/g, '\\$&') // Escape regex + .replace(/\n/g, '\n \\* ?') // Per line space+asterisk, optional space + .replace('YEAR_PLACEHOLDER', '2\\d{3}'); const fileHeaderDefault = - fileHeaderTemplate.replace('YEAR_PLACEHOLDER', new Date().getFullYear()); + fileHeaderTemplate.replace('YEAR_PLACEHOLDER', new Date().getFullYear()); const rules = { 'file-header': [ @@ -50,6 +50,11 @@ const rules = { 'default': fileHeaderDefault, }, ], + 'naming-convention': [true, + { 'type': 'property', 'modifiers': 'protected', 'leadingUnderscore': 'require' }, + { 'type': 'member', 'modifiers': 'private', 'leadingUnderscore': 'require' }, + { 'type': 'enumMember', 'format': 'UPPER_CASE' }, + ] }; module.exports = {