Class EslintOptions.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.javascript.EslintOptions.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<EslintOptions>
- Enclosing interface:
- EslintOptions
@Stability(Experimental) public static final class EslintOptions.Builder extends Object implements software.amazon.jsii.Builder<EslintOptions>
A builder forEslintOptions
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
dirs
@Stability(Experimental) public EslintOptions.Builder dirs(List<String> dirs)
Sets the value ofEslintOptions.getDirs()- Parameters:
dirs- Files or glob patterns or directories with source files to lint (e.g. [ "src" ]). This parameter is required.- Returns:
this
-
aliasExtensions
@Stability(Experimental) public EslintOptions.Builder aliasExtensions(List<String> aliasExtensions)
Sets the value ofEslintOptions.getAliasExtensions()- Parameters:
aliasExtensions- Enable import alias for module paths.- Returns:
this
-
aliasMap
@Stability(Experimental) public EslintOptions.Builder aliasMap(Map<String,String> aliasMap)
Sets the value ofEslintOptions.getAliasMap()- Parameters:
aliasMap- Enable import alias for module paths.- Returns:
this
-
devdirs
@Stability(Experimental) public EslintOptions.Builder devdirs(List<String> devdirs)
Sets the value ofEslintOptions.getDevdirs()- Parameters:
devdirs- Files or glob patterns or directories with source files that include tests and build tools. These sources are linted but may also import packages fromdevDependencies.- Returns:
this
-
fileExtensions
@Stability(Experimental) public EslintOptions.Builder fileExtensions(List<String> fileExtensions)
Sets the value ofEslintOptions.getFileExtensions()- Parameters:
fileExtensions- File types that should be linted (e.g. [ ".js", ".ts" ]).- Returns:
this
-
ignorePatterns
@Stability(Experimental) public EslintOptions.Builder ignorePatterns(List<String> ignorePatterns)
Sets the value ofEslintOptions.getIgnorePatterns()- Parameters:
ignorePatterns- List of file patterns that should not be linted, using the same syntax as .gitignore patterns.- Returns:
this
-
lintProjenRc
@Stability(Deprecated) @Deprecated public EslintOptions.Builder lintProjenRc(Boolean lintProjenRc)
Deprecated.set to `false` to remove any automatic rules and add manuallySets the value ofEslintOptions.getLintProjenRc()- Parameters:
lintProjenRc- Should we lint .projenrc.js.- Returns:
this
-
lintProjenRcFile
@Stability(Deprecated) @Deprecated public EslintOptions.Builder lintProjenRcFile(String lintProjenRcFile)
Deprecated.provide as `devdirs`Sets the value ofEslintOptions.getLintProjenRcFile()- Parameters:
lintProjenRcFile- Projenrc file to lint. Use empty string to disable.- Returns:
this
-
prettier
@Stability(Experimental) public EslintOptions.Builder prettier(Boolean prettier)
Sets the value ofEslintOptions.getPrettier()- Parameters:
prettier- Enable prettier for code formatting.- Returns:
this
-
tsAlwaysTryTypes
@Stability(Experimental) public EslintOptions.Builder tsAlwaysTryTypes(Boolean tsAlwaysTryTypes)
Sets the value ofEslintOptions.getTsAlwaysTryTypes()- Parameters:
tsAlwaysTryTypes- Always try to resolve types under<root>@typesdirectory even it doesn't contain any source code. This preventsimport/no-unresolvedeslint errors when importing a@types/*module that would otherwise remain unresolved.- Returns:
this
-
tsconfigPath
@Stability(Experimental) public EslintOptions.Builder tsconfigPath(String tsconfigPath)
Sets the value ofEslintOptions.getTsconfigPath()- Parameters:
tsconfigPath- Path totsconfig.jsonwhich should be used by eslint.- Returns:
this
-
yaml
@Stability(Experimental) public EslintOptions.Builder yaml(Boolean yaml)
Sets the value ofEslintOptions.getYaml()- Parameters:
yaml- Write eslint configuration as YAML instead of JSON.- Returns:
this
-
build
@Stability(Experimental) public EslintOptions build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<EslintOptions>- Returns:
- a new instance of
EslintOptions - Throws:
NullPointerException- if any required attribute was not provided
-
-