Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tjw-lint/eslint-config-tjw-import
Strict JS import linting rules
https://github.com/tjw-lint/eslint-config-tjw-import
Last synced: 9 days ago
JSON representation
Strict JS import linting rules
- Host: GitHub
- URL: https://github.com/tjw-lint/eslint-config-tjw-import
- Owner: tjw-lint
- License: mit
- Created: 2022-03-09T23:25:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-27T15:37:14.000Z (7 months ago)
- Last Synced: 2024-10-01T17:50:30.882Z (about 2 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# eslint-config-tjw-import
The Jared Wilcurt's strict ESLint rules for importing files.
## Using this
1. `npm install --save-dev eslint-plugin-import eslint-config-tjw-import`
1. In your `.eslitrc.js` add `tjw-import` to your `extends` like so:
```js
module.exports = {
extends: [
'tjw-import'
]
};
```## Vite/Webpack aliases
You may optionally want to add in an import resolver if you use **Vite** or **Webpack** for aliasing. The below code says "webpack" but works for both.
`npm install --save-dev eslint-import-resolver-webpack`
```js
// .eslintrc.js
const path = require('path');module.exports = {
extends: [
'tjw-import'
],
settings: {
'import/resolver': {
webpack: {
config: {
resolve: {
alias: {
'@': path.resolve('src'),
'@@': path.resolve('tests'),
'@@@': path.resolve('docs')
}
}
}
}
}
}
};
```* * *
**See also:**
* [eslint-config-tjw-base](https://github.com/tjw-lint/eslint-config-tjw-base)
* [eslint-config-tjw-import](https://github.com/tjw-lint/eslint-config-tjw-import)
* [eslint-config-tjw-jest](https://github.com/tjw-lint/eslint-config-tjw-jest)
* [eslint-config-tjw-jsdoc](https://github.com/tjw-lint/eslint-config-tjw-jsdoc)
* [eslint-config-tjw-vue](https://github.com/tjw-lint/eslint-config-tjw-vue)