mirror of
https://github.com/coderaiser/minify.git
synced 2025-12-05 18:55:58 -06:00
feature: overrides
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"rules": {
|
||||
"node/no-unsupported-features/node-builtins": "off"
|
||||
},
|
||||
"overrides": [{
|
||||
"files": ["bin/**/*.js"],
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
}
|
||||
}],
|
||||
"extends": [
|
||||
"plugin:n/recommended",
|
||||
"plugin:putout/recommended"
|
||||
],
|
||||
"plugins": [
|
||||
"putout",
|
||||
"n"
|
||||
]
|
||||
}
|
||||
4
.github/workflows/node.js.yml
vendored
4
.github/workflows/node.js.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
node-version:
|
||||
- 18.x
|
||||
- 20.x
|
||||
- 21.x
|
||||
- 22.x
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
run: npm run fix:lint
|
||||
- name: Install Rust
|
||||
run: rustup update
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
|
||||
4
.github/workflows/nodejs-pr.yml
vendored
4
.github/workflows/nodejs-pr.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
node-version:
|
||||
- 18.x
|
||||
- 20.x
|
||||
- 21.x
|
||||
- 22.x
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
run: npm run lint
|
||||
- name: Install Rust
|
||||
run: rustup update
|
||||
- uses: actions/cache@v3
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
|
||||
@@ -7,3 +7,4 @@ CONTRIBUTING.md
|
||||
yarn-error.log
|
||||
|
||||
_*
|
||||
*.config.*
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"**/*.spec.*",
|
||||
"**/fixture",
|
||||
"test",
|
||||
".*.{js,mjs}"
|
||||
".*.{js,mjs}",
|
||||
"**/*.config.*"
|
||||
],
|
||||
"branches": 100,
|
||||
"lines": 100,
|
||||
|
||||
3
eslint.config.js
Normal file
3
eslint.config.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import {safeAlign} from 'eslint-plugin-putout/config';
|
||||
|
||||
export default safeAlign;
|
||||
@@ -13,7 +13,7 @@ const minifiers = [
|
||||
|
||||
export default async (data, options) => {
|
||||
let error;
|
||||
let result;
|
||||
let result = data;
|
||||
|
||||
for (const minify of minifiers) {
|
||||
[error, result] = await tryToCatch(minify, data, options);
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import {findUp} from 'find-up';
|
||||
import _readjson from 'readjson';
|
||||
|
||||
export async function readOptions({readjson = _readjson, find = findUp} = {}) {
|
||||
export async function readOptions(overrides = {}) {
|
||||
const {
|
||||
readjson = _readjson,
|
||||
find = findUp,
|
||||
} = overrides;
|
||||
|
||||
const optionsPath = await find('.minify.json');
|
||||
|
||||
if (!optionsPath)
|
||||
|
||||
@@ -52,7 +52,6 @@
|
||||
"devDependencies": {
|
||||
"escover": "^4.0.0",
|
||||
"eslint": "^9.3.0",
|
||||
"eslint-plugin-n": "^16.0.0",
|
||||
"eslint-plugin-putout": "^22.1.0",
|
||||
"madrun": "^10.0.0",
|
||||
"putout": "^35.5.2",
|
||||
|
||||
@@ -77,7 +77,7 @@ test('minify: auto: not found', async (t) => {
|
||||
},
|
||||
});
|
||||
|
||||
t.equal(js, result);
|
||||
t.notOk(result);
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user