1.9.5 • Published 1 year ago

@atws/projen-config v1.9.5

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@atws/projen-config

npm

This package contains extensions for projen.

Usage

Install the package:

yarn add -D @atws/projen-config

Add to your .projenrc.ts file:

import { awscdk } from 'projen'
import {
  PrettierConfig,
  EslintConfig,
  VscodeConfig,
  GitConfig,
} from "@atws/projen-config"

const project = new awscdk.AwsCdkConstructLibrary({ 
  devDeps: ["@atws/projen-config"],
})

new PrettierConfig(project)

new EslintConfig(project, {
  cdkFileRegex: "**/src/**/*.ts",
  reactFileRegex: "**/webapp/**/*.{ts,tsx}",
})

new VscodeConfig(project, {
  additionalSearchExclusion: {
    '**/public': true,
  },
})

new GitConfig(project)

Features

Setup @atws/prettier-config

An opinionated base config for prettier. In contrast to the default config, it uses single quotes, adds a trailing comma to objects and arrays and does not use semicolons at the end.

new PrettierConfig(project)

Setup @atws/eslint-config

Add an opinionated base config for eslint. It allows to specify the file regex for projects that use AWS CDK and/or React.

new EslintConfig(project, {
  cdkFileRegex: "**/src/**/*.ts",
  reactFileRegex: "**/webapp/**/*.{ts,tsx}",
})

Setup a VS Code workspace settings file

Add a .vscode/settings.json and .vscode/extensions.json file to the project. It defines some standard search exclusions and enables formatOnSave. The extensions file is used to recommend extensions that should be installed for the project.

new VscodeConfig(project, {
  additionalSearchExclusion: {
    '**/public': true,
  },
  additionalSettings: {
    'editor.stickyScroll.enabled': true,
  },
  vscodeExtensions: {
    addCdkExtensions: true,
    addCoreExtensions: true,
    additionalExtensions: ['ms-azuretools.vscode-docker'],
    addNodeExtensions: true,
    addProductivityExtensions: true,
    addReactExtensions: true,
    addTailwindCSSExtensions: true,
  },
})

Setup a .gitattributes file

Modify the .gitattributes file to use LF line endings for all files, use binary encoding and treat VSCode settings files as JSON5.

new GitConfig(project, {
  gitAttributes: {
    additionalLines: [
      {
        glob: '/packages/api/generated/**',
        attribute: 'linguist-generated',
      },
    ],
  },
})
1.9.5

1 year ago

1.9.4

1 year ago

1.9.3

1 year ago

1.9.2

1 year ago

1.9.1

1 year ago

1.9.0

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.5

1 year ago

1.0.0

1 year ago