-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also, setup vitest and esbuild, along with some tests.
- Loading branch information
Showing
29 changed files
with
1,118 additions
and
2,278 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
# replace this | ||
# @cloudy-ts/eslint-plugin | ||
|
||
ESLint plugin that provides a rule to enforce explicit `.js` or `.json` extensions on imports. | ||
|
||
[![NPM version](https://img.shields.io/npm/v/@cloudy-ts/eslint-plugin/latest.svg)](https://www.npmjs.com/package/@cloudy-ts/eslint-plugin) | ||
[![NPM downloads](https://img.shields.io/npm/dm/@cloudy-ts/eslint-plugin.svg)](https://www.npmjs.com/package/@cloudy-ts/eslint-plugin) | ||
[![Build status](https://img.shields.io/github/workflow/status/skyrpex/cloudy-ts-eslint-plugin/release)](https://www.npmjs.com/package/@cloudy-ts/eslint-plugin) | ||
|
||
## Installation | ||
|
||
```sh | ||
yarn add @cloudy-ts/eslint-plugin -D | ||
``` | ||
|
||
## Usage | ||
|
||
Extend from the recommended configuration in your ESLint configuration file (ie, in your `package.json` file): | ||
|
||
```json | ||
{ | ||
"name": "my-awesome-project", | ||
"eslintConfig": { | ||
"extends": "plugin:@cloudy-ts/recommended" | ||
} | ||
} | ||
``` | ||
|
||
## Rules | ||
|
||
Each rule has emojis denoting: | ||
|
||
- ✅ if it belongs to the `recommended` configuration | ||
- 🔧 if some problems reported by the rule are automatically fixable by the `--fix` [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) option | ||
- 💡 if some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions) | ||
|
||
| Name | Description | ✅ | 🔧 | 💡 | | ||
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------- | :-- | :-- | :-- | | ||
| [extensions](docs/rules/extensions.md) | Enforce import and export file extensions. | ✅ | 🔧 | 💡 | | ||
|
||
## Motivation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Enforce import and export file extensions | ||
|
||
In ESM, import paths and export paths must contain the file extension in it. This rule suggests and fixes the imports for you. | ||
|
||
## Fail | ||
|
||
```js | ||
import { add } from "./math"; | ||
|
||
import { add } from "./math.ts"; | ||
|
||
import pkg from "./package"; | ||
``` | ||
|
||
## Pass | ||
|
||
```js | ||
import { add } from "./math.js"; | ||
|
||
import pkg from "./package.json"; | ||
``` |
Oops, something went wrong.