encore-loader
v1.1.1
Published
#### Methods ``` - loadCSS(string) - loadJS(string) ```
Downloads
5,264
Maintainers
Keywords
Readme
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
- Go to File ➤ Settings / Default Settings ➤ Languages and Frameworks ➤ TypeScript ➤ TSLint
- Click "Enable" checkbox
- Select Node interpreter
- Specify path to tslint package which is inside the project's
node_modules
folder.
VSCode
- Go to: View -> Extension or press CTRL + SHIFT + X
- Search for "TSLint" extension, click it and press "Install" button
- 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.