Unverified Commit e72ac764 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Remove tslint disables (#16116)

We no longer use tslint so these comments don't do anything.
parent c154a878
...@@ -7,7 +7,6 @@ import { NON_STANDARD_NODE_ENV } from '../lib/constants' ...@@ -7,7 +7,6 @@ import { NON_STANDARD_NODE_ENV } from '../lib/constants'
// When 'npm link' is used it checks the clone location. Not the project. // When 'npm link' is used it checks the clone location. Not the project.
require.resolve(dependency) require.resolve(dependency)
} catch (err) { } catch (err) {
// tslint:disable-next-line
console.warn( console.warn(
`The module '${dependency}' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install ${dependency}'` `The module '${dependency}' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install ${dependency}'`
) )
...@@ -44,7 +43,6 @@ const args = arg( ...@@ -44,7 +43,6 @@ const args = arg(
// Version is inlined into the file using taskr build pipeline // Version is inlined into the file using taskr build pipeline
if (args['--version']) { if (args['--version']) {
// tslint:disable-next-line
console.log(`Next.js v${process.env.__NEXT_VERSION}`) console.log(`Next.js v${process.env.__NEXT_VERSION}`)
process.exit(0) process.exit(0)
} }
...@@ -55,7 +53,6 @@ const foundCommand = Boolean(commands[args._[0]]) ...@@ -55,7 +53,6 @@ const foundCommand = Boolean(commands[args._[0]])
// Makes sure the `next <subcommand> --help` case is covered // Makes sure the `next <subcommand> --help` case is covered
// This help message is only showed for `next --help` // This help message is only showed for `next --help`
if (!foundCommand && args['--help']) { if (!foundCommand && args['--help']) {
// tslint:disable-next-line
console.log(` console.log(`
Usage Usage
$ next <command> $ next <command>
...@@ -113,7 +110,6 @@ if (command === 'dev') { ...@@ -113,7 +110,6 @@ if (command === 'dev') {
const { watchFile } = require('fs') const { watchFile } = require('fs')
watchFile(`${process.cwd()}/${CONFIG_FILE}`, (cur: any, prev: any) => { watchFile(`${process.cwd()}/${CONFIG_FILE}`, (cur: any, prev: any) => {
if (cur.size > 0 || prev.size > 0) { if (cur.size > 0 || prev.size > 0) {
// tslint:disable-next-line
console.log( console.log(
`\n> Found a change in ${CONFIG_FILE}. Restart the server to see the changes in effect.` `\n> Found a change in ${CONFIG_FILE}. Restart the server to see the changes in effect.`
) )
......
...@@ -30,7 +30,6 @@ const nextDev: cliCommand = (argv) => { ...@@ -30,7 +30,6 @@ const nextDev: cliCommand = (argv) => {
throw error throw error
} }
if (args['--help']) { if (args['--help']) {
// tslint:disable-next-line
console.log(` console.log(`
Description Description
Starts the application in development mode (hot-code reloading, error Starts the application in development mode (hot-code reloading, error
...@@ -119,10 +118,8 @@ const nextDev: cliCommand = (argv) => { ...@@ -119,10 +118,8 @@ const nextDev: cliCommand = (argv) => {
errorMessage += `\nUse \`npm run ${nextScript[0]} -- -p <some other port>\`.` errorMessage += `\nUse \`npm run ${nextScript[0]} -- -p <some other port>\`.`
} }
} }
// tslint:disable-next-line
console.error(errorMessage) console.error(errorMessage)
} else { } else {
// tslint:disable-next-line
console.error(err) console.error(err)
} }
process.nextTick(() => process.exit(1)) process.nextTick(() => process.exit(1))
......
...@@ -29,7 +29,6 @@ const nextExport: cliCommand = (argv) => { ...@@ -29,7 +29,6 @@ const nextExport: cliCommand = (argv) => {
throw error throw error
} }
if (args['--help']) { if (args['--help']) {
// tslint:disable-next-line
console.log(` console.log(`
Description Description
Exports the application for production deployment Exports the application for production deployment
......
...@@ -29,7 +29,6 @@ const nextStart: cliCommand = (argv) => { ...@@ -29,7 +29,6 @@ const nextStart: cliCommand = (argv) => {
throw error throw error
} }
if (args['--help']) { if (args['--help']) {
// tslint:disable-next-line
console.log(` console.log(`
Description Description
Starts the application in production mode. Starts the application in production mode.
...@@ -53,14 +52,12 @@ const nextStart: cliCommand = (argv) => { ...@@ -53,14 +52,12 @@ const nextStart: cliCommand = (argv) => {
const port = args['--port'] || 3000 const port = args['--port'] || 3000
startServer({ dir }, port, args['--hostname']) startServer({ dir }, port, args['--hostname'])
.then(async (app) => { .then(async (app) => {
// tslint:disable-next-line
Log.ready( Log.ready(
`started server on http://${args['--hostname'] || 'localhost'}:${port}` `started server on http://${args['--hostname'] || 'localhost'}:${port}`
) )
await app.prepare() await app.prepare()
}) })
.catch((err) => { .catch((err) => {
// tslint:disable-next-line
console.error(err) console.error(err)
process.exit(1) process.exit(1)
}) })
......
...@@ -94,9 +94,7 @@ routerEvents.forEach((event) => { ...@@ -94,9 +94,7 @@ routerEvents.forEach((event) => {
try { try {
_singletonRouter[eventField](...args) _singletonRouter[eventField](...args)
} catch (err) { } catch (err) {
// tslint:disable-next-line:no-console
console.error(`Error when running the Router event: ${eventField}`) console.error(`Error when running the Router event: ${eventField}`)
// tslint:disable-next-line:no-console
console.error(`${err.message}\n${err.stack}`) console.error(`${err.message}\n${err.stack}`)
} }
} }
......
...@@ -32,7 +32,6 @@ export default function mitt(): MittEmitter { ...@@ -32,7 +32,6 @@ export default function mitt(): MittEmitter {
off(type: string, handler: Handler) { off(type: string, handler: Handler) {
if (all[type]) { if (all[type]) {
// tslint:disable-next-line:no-bitwise
all[type].splice(all[type].indexOf(handler) >>> 0, 1) all[type].splice(all[type].indexOf(handler) >>> 0, 1)
} }
}, },
......
...@@ -103,7 +103,6 @@ export type NEXT_DATA = { ...@@ -103,7 +103,6 @@ export type NEXT_DATA = {
/** /**
* `Next` context * `Next` context
*/ */
// tslint:disable-next-line interface-name
export interface NextPageContext { export interface NextPageContext {
/** /**
* Error object if encountered during rendering * Error object if encountered during rendering
......
...@@ -20,7 +20,6 @@ export function getPageFiles( ...@@ -20,7 +20,6 @@ export function getPageFiles(
let files = buildManifest.pages[normalizedPage] let files = buildManifest.pages[normalizedPage]
if (!files) { if (!files) {
// tslint:disable-next-line
console.warn( console.warn(
`Could not find files for ${normalizedPage} in .next/build-manifest.json` `Could not find files for ${normalizedPage} in .next/build-manifest.json`
) )
......
...@@ -253,7 +253,6 @@ export default class Server { ...@@ -253,7 +253,6 @@ export default class Server {
this.onErrorMiddleware({ err }) this.onErrorMiddleware({ err })
} }
if (this.quiet) return if (this.quiet) return
// tslint:disable-next-line
console.error(err) console.error(err)
} }
......
...@@ -33,7 +33,6 @@ export function getPagePath( ...@@ -33,7 +33,6 @@ export function getPagePath(
try { try {
page = denormalizePagePath(normalizePagePath(page)) page = denormalizePagePath(normalizePagePath(page))
} catch (err) { } catch (err) {
// tslint:disable-next-line
console.error(err) console.error(err)
throw pageNotFoundError(page) throw pageNotFoundError(page)
} }
......
export function printAndExit(message: string, code = 1) { export function printAndExit(message: string, code = 1) {
if (code === 0) { if (code === 0) {
// tslint:disable-next-line no-console
console.log(message) console.log(message)
} else { } else {
console.error(message) console.error(message)
......
...@@ -600,7 +600,6 @@ declare module 'webpack' { ...@@ -600,7 +600,6 @@ declare module 'webpack' {
type Rule = RuleSetRule type Rule = RuleSetRule
namespace Options { namespace Options {
// tslint:disable-next-line:max-line-length
type Devtool = type Devtool =
| 'eval' | 'eval'
| 'inline-source-map' | 'inline-source-map'
...@@ -869,13 +868,10 @@ declare module 'webpack' { ...@@ -869,13 +868,10 @@ declare module 'webpack' {
modulesSize(): number modulesSize(): number
size(options: any): number size(options: any): number
integratedSize(otherChunk: any, options: any): number integratedSize(otherChunk: any, options: any): number
// tslint:disable-next-line:ban-types
sortModules(sortByFn: Function): void sortModules(sortByFn: Function): void
getAllAsyncChunks(): Set<any> getAllAsyncChunks(): Set<any>
getChunkMaps(realHash: any): { hash: any; name: any } getChunkMaps(realHash: any): { hash: any; name: any }
// tslint:disable-next-line:ban-types
getChunkModuleMaps(filterFn: Function): { id: any; hash: any } getChunkModuleMaps(filterFn: Function): { id: any; hash: any }
// tslint:disable-next-line:ban-types
hasModuleInGraph(filterFn: Function, filterChunkFn: Function): boolean hasModuleInGraph(filterFn: Function, filterChunkFn: Function): boolean
toString(): string toString(): string
} }
...@@ -1132,7 +1128,6 @@ declare module 'webpack' { ...@@ -1132,7 +1128,6 @@ declare module 'webpack' {
hash?: string hash?: string
getStats(): Stats getStats(): Stats
addModule(module: CompilationModule, cacheGroup: any): any addModule(module: CompilationModule, cacheGroup: any): any
// tslint:disable-next-line:ban-types
addEntry(context: any, entry: any, name: any, callback: Function): void addEntry(context: any, entry: any, name: any, callback: Function): void
getPath( getPath(
filename: string, filename: string,
...@@ -1256,7 +1251,6 @@ declare module 'webpack' { ...@@ -1256,7 +1251,6 @@ declare module 'webpack' {
watchRun: any watchRun: any
} }
} }
// tslint:disable-next-line:interface-name
interface ICompiler { interface ICompiler {
run(handler: ICompiler.Handler): void run(handler: ICompiler.Handler): void
watch( watch(
...@@ -1877,7 +1871,6 @@ declare module 'webpack' { ...@@ -1877,7 +1871,6 @@ declare module 'webpack' {
} }
class PrefetchPlugin extends Plugin { class PrefetchPlugin extends Plugin {
// tslint:disable-next-line:unified-signatures
constructor(context: any, request: any) constructor(context: any, request: any)
constructor(request: any) constructor(request: any)
} }
...@@ -2363,7 +2356,6 @@ declare module 'webpack' { ...@@ -2363,7 +2356,6 @@ declare module 'webpack' {
/** @deprecated */ /** @deprecated */
namespace compiler { namespace compiler {
/** @deprecated use webpack.Compiler */ /** @deprecated use webpack.Compiler */
// tslint:disable-next-line:no-unnecessary-qualifier
type Compiler = webpack.Compiler type Compiler = webpack.Compiler
/** @deprecated use webpack.Compiler.Watching */ /** @deprecated use webpack.Compiler.Watching */
...@@ -2374,7 +2366,6 @@ declare module 'webpack' { ...@@ -2374,7 +2366,6 @@ declare module 'webpack' {
type WatchOptions = Compiler.WatchOptions type WatchOptions = Compiler.WatchOptions
/** @deprecated use webpack.Stats */ /** @deprecated use webpack.Stats */
// tslint:disable-next-line:no-unnecessary-qualifier
type Stats = webpack.Stats type Stats = webpack.Stats
/** @deprecated use webpack.Stats.ToJsonOptions */ /** @deprecated use webpack.Stats.ToJsonOptions */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment