Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.
This repository was archived by the owner on May 1, 2020. It is now read-only.

Can't override linterOptions in tslint.json #1463

@Pumpuli

Description

@Pumpuli

Short description of the problem:

Adding linterOptions to tslint.json has no effect.

What behavior are you expecting?

Adding linterOptions to tslint.json should work, e.g. exclude some project files from linting.

Steps to reproduce:

  1. Create a new project
  2. Add some linter options to tslint.json (example below)
  3. Edit home page code and introduce a linting error
  4. Run ionic-app-scripts lint
{
    "linterOptions": {
        "exclude": ["src/pages/**/*"]
    },
    ...
}

Which @ionic/app-scripts version are you using?

3.1.0

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

export function getTsLintConfig(tsLintConfig: string, linterOptions?: LinterOptions): LinterConfig {
const config = Configuration.loadConfigurationFromPath(tsLintConfig);
Object.assign(config, isObject(linterOptions) ? {linterOptions} : {});
return config;
}

The above function should be something like this:

const mergedLinterOptions = Object.assign({}, config.linterOptions, linterOptions);
Object.assign(config, { linterOptions: mergedLinterOptions });

Possibly related PR: #1204

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions