feature: overrides

This commit is contained in:
coderaiser
2024-05-21 19:29:11 +03:00
parent 7707cea134
commit dd36ed2266
10 changed files with 18 additions and 28 deletions

View File

@@ -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"
]
}

View File

@@ -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/

View File

@@ -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/

View File

@@ -7,3 +7,4 @@ CONTRIBUTING.md
yarn-error.log
_*
*.config.*

View File

@@ -5,7 +5,8 @@
"**/*.spec.*",
"**/fixture",
"test",
".*.{js,mjs}"
".*.{js,mjs}",
"**/*.config.*"
],
"branches": 100,
"lines": 100,

3
eslint.config.js Normal file
View File

@@ -0,0 +1,3 @@
import {safeAlign} from 'eslint-plugin-putout/config';
export default safeAlign;

View File

@@ -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);

View File

@@ -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)

View File

@@ -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",

View File

@@ -77,7 +77,7 @@ test('minify: auto: not found', async (t) => {
},
});
t.equal(js, result);
t.notOk(result);
t.end();
});