https://github.com/doochik/eslint-plugin-nommon
ESLint plugin for nommon (https://github.com/pasaran/nommon)
https://github.com/doochik/eslint-plugin-nommon
Last synced: 5 months ago
JSON representation
ESLint plugin for nommon (https://github.com/pasaran/nommon)
- Host: GitHub
- URL: https://github.com/doochik/eslint-plugin-nommon
- Owner: doochik
- License: mit
- Created: 2019-11-26T08:15:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-16T09:34:51.000Z (8 months ago)
- Last Synced: 2025-11-16T11:23:24.504Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 429 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://badge.fury.io/js/eslint-plugin-nommon)
# eslint-plugin-nommon
ESLint plugin for [nommon](https://github.com/pasaran/nommon)
## Installation
```
$ npm install eslint-plugin-nommon --save-dev
```
## Usage
Add `eslint-plugin-nommon` to the plugins section of your `.eslintrc` configuration file:
```json
{
"plugins": [
"eslint-plugin-nommon"
]
}
```
Then configure the rules you want to use under the rules section.
```json
{
"rules": {
"nommon/no-dynamic-jpath": "error"
}
}
```
### Rule "nommon/no-dynamic-jpath"
**autofixable**
`nommon/no-dynamic-jpath` disallow JS variables in no.jpath().
**Motivation**: `no.jpath()` compiles given `jpath` to native JS function and stores it in cache.
Dynamic `jpath` may increase memory usage and decrease application performance due to `jpath` compilation.
You should use only static strings in `jpath`.
Bad examples:
```javascript
no.jpath('.foo.' + bar, data);
no.jpath(`.foo.${ bar }`, data);
no.jpath(`.foo{ .bar === "${ baz }"`, data);
```
Good examples:
```javascript
no.jpath('.foo' + '.bar', data);
no.jpath('.foo[bar]', data, { bar });
no.jpath('.foo{ .bar === baz}', data, { baz });
```