encore-loader
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Loader_fe

Methods

- loadCSS(string)
- loadJS(string)

Usage

- loadCSS('https://img.tfd.com/all.css')
     .then(() => {...})
     .catch(() => {...})

Setup steps

- Run `git config core.hooksPath .githooks` to configure git hooks
- Run `npm i` to install dependencies

Dev dependencies

node: >= 10.10.0,
npm: >= 6.4.1

Code Analysis Tools

We use some open source tools to perform static code analysis:

  • TSLint
  • Stylelint

These tools are automated and doesn't require manual work once they've been set up. They are also integrated in our continuous integration process.

TSLint

Linting is a process of checking the source code for stylistic as well as programmatic errors. TSLint helps to identify some mistakes that are made during coding. It is also used for adhering best practices and improving code quality and readability.

Our TypeScript code is written in compliance with recommended style guide. It is a set of standards that outline how code should be written and organized and it covers nearly every aspect of TypeScript. We use TSLint with recommended config.

You can run TSLint manually with the following command: npm run lint:ts.

Setup your IDE/Editor to show you TSLint errors and warnings:

WebStorm
  1. Go to File ➤ Settings / Default Settings ➤ Languages and Frameworks ➤ TypeScript ➤ TSLint
  2. Click "Enable" checkbox
  3. Select Node interpreter
  4. Specify path to tslint package which is inside the project's node_modules folder.
VSCode
  1. Go to: View -> Extension or press CTRL + SHIFT + X
  2. Search for "TSLint" extension, click it and press "Install" button
  3. Press "Reload" button or reopen the editor

Stylelint

Stylelint is a linter that helps to avoid errors and enforce conventions in styles. It understands the latest CSS syntax, parses SCSS, extracts embedded styles from HTML, markdown and CSS-in-JS template literals.

It is used with "stylelint-config-standard" which extends recommended Stylelint config and turns on additional rules to enforce the common stylistic conventions found within a handful of CSS styleguides, including: The Idiomatic CSS Principles, Google's CSS Style Guide and Airbnb's Styleguide.

You can run Stylelint manually with the following command: npm run lint:css.

The setup process for your IDE is similar to TSLint. I'm sure you'll figure it out.

Readme

Keywords

none

Package Sidebar

Install

npm i encore-loader

Weekly Downloads

1,126

Version

1.1.1

License

none

Unpacked Size

5.76 kB

Total Files

5

Last publish

Collaborators

  • joaquinvolpe
  • dpiletski
  • shivalijindal
  • xiaottg
  • leonardo.moreno
  • galvogalvo
  • chasenyc
  • paulrumyantsevitr
  • yuriyibc