@gesslar/uglier 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -59
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -177,65 +177,6 @@ npm install --save-dev @gesslar/uglier eslint
|
|
|
177
177
|
|
|
178
178
|
Note: `@stylistic/eslint-plugin`, `eslint-plugin-jsdoc`, and `globals` are bundled as dependencies.
|
|
179
179
|
|
|
180
|
-
## Advanced Integration
|
|
181
|
-
|
|
182
|
-
### ServiceNow Projects
|
|
183
|
-
|
|
184
|
-
ServiceNow development requires special handling because your code runs in two environments: the ServiceNow SDK tools use Node.js, but your application code runs on the ServiceNow Rhino engine (which doesn't support Node APIs).
|
|
185
|
-
|
|
186
|
-
The `@servicenow/eslint-plugin-sdk-app-plugin` uses the legacy `.eslintrc` format. To integrate it with `uglier`, you'll need the `FlatCompat` compatibility layer.
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
npm install --save-dev @eslint/eslintrc @servicenow/eslint-plugin-sdk-app-plugin
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
```js
|
|
193
|
-
import uglify from "@gesslar/uglier"
|
|
194
|
-
import {FlatCompat} from "@eslint/eslintrc"
|
|
195
|
-
import path from "path"
|
|
196
|
-
import {fileURLToPath} from "url"
|
|
197
|
-
import serviceNowPlugin from "@servicenow/eslint-plugin-sdk-app-plugin"
|
|
198
|
-
|
|
199
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
200
|
-
const __dirname = path.dirname(__filename)
|
|
201
|
-
const compat = new FlatCompat({baseDirectory: __dirname})
|
|
202
|
-
|
|
203
|
-
export default [
|
|
204
|
-
...uglify({
|
|
205
|
-
with: ["lints-js"],
|
|
206
|
-
overrides: {
|
|
207
|
-
"lints-js": {files: ["src/**/*.js"]}
|
|
208
|
-
}
|
|
209
|
-
}),
|
|
210
|
-
{
|
|
211
|
-
files: ["src/**/*.js"],
|
|
212
|
-
plugins: {"@servicenow/sdk-app-plugin": serviceNowPlugin}
|
|
213
|
-
},
|
|
214
|
-
...compat.extends("plugin:@servicenow/sdk-app-plugin/recommended")
|
|
215
|
-
]
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
The `FlatCompat` layer bridges legacy plugins into flat config. When ServiceNow releases a flat config version of their plugin, you can drop the compatibility layer and use it directly.
|
|
219
|
-
|
|
220
|
-
### Other Legacy Plugins
|
|
221
|
-
|
|
222
|
-
Many enterprise plugins haven't migrated to flat config yet. Use the same `FlatCompat` pattern:
|
|
223
|
-
|
|
224
|
-
```js
|
|
225
|
-
import {FlatCompat} from "@eslint/eslintrc"
|
|
226
|
-
import path from "path"
|
|
227
|
-
import {fileURLToPath} from "url"
|
|
228
|
-
|
|
229
|
-
const __filename = fileURLToPath(import.meta.url)
|
|
230
|
-
const __dirname = path.dirname(__filename)
|
|
231
|
-
const compat = new FlatCompat({baseDirectory: __dirname})
|
|
232
|
-
|
|
233
|
-
export default [
|
|
234
|
-
...uglify({with: ["lints-js", "node"]}),
|
|
235
|
-
...compat.extends("plugin:legacy-plugin/recommended")
|
|
236
|
-
]
|
|
237
|
-
```
|
|
238
|
-
|
|
239
180
|
## Philosophy
|
|
240
181
|
|
|
241
182
|
This config enforces:
|