diff --git a/.codeclimate.yml b/.codeclimate.yml index c889eb8..563da6b 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,9 +1,9 @@ engines: eslint: enabled: true - channel: 'eslint-8' + channel: 'eslint-9' config: - config: '.eslintrc.yaml' + config: 'eslint.config.mjs' ratings: paths: diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index 4c1bf2a..0000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -env: - node: true - es6: true - mocha: true - es2022: true - -extends: ['@haraka'] - -rules: - no-unused-vars: 1 diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 8ded5e0..0000000 --- a/.prettierrc +++ /dev/null @@ -1,2 +0,0 @@ -singleQuote: true -semi: false diff --git a/.release b/.release index afb1db8..180d818 160000 --- a/.release +++ b/.release @@ -1 +1 @@ -Subproject commit afb1db801607dda5e859f39b600f0dd0111e4651 +Subproject commit 180d818a31f69b7f0295cd0eb85cb44c45439a8b diff --git a/CHANGELOG.md b/CHANGELOG.md index da7121a..fb6058c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Unreleased +### [1.0.2] - 2025-01-30 + +- replace .replace(//g) with a replaceAll +- prettier: move config into package.json +- dep(eslint): upgrade to v9 +- dep(all): bump versions +- doc(CONTRIBUTORS): added + ### [1.0.1] - 2024-11-04 - Merge pull request #2 from lnedry/master - - fix: removed redundant timer. - chore: remove unused set of conn.notes.prev_helo @@ -15,5 +22,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). - initial release -[1.0.0]: https://github.com/haraka/haraka-plugin-template/releases/tag/v1.0.0 +[1.0.0]: https://github.com/haraka/haraka-plugin-helo.checks/releases/tag/v1.0.0 [1.0.1]: https://github.com/haraka/haraka-plugin-helo.checks/releases/tag/v1.0.1 +[1.0.2]: https://github.com/haraka/haraka-plugin-helo.checks/releases/tag/v1.0.2 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..aff93a2 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,9 @@ +# Contributors + +This handcrafted artisinal software is brought to you by: + +|
msimerson (7) |
lnedry (2) | +| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | + +this file is generated by [.release](https://github.com/msimerson/.release). +Contribute to this project to get your GitHub profile included here. diff --git a/README.md b/README.md index b9c1f87..412b494 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ [![CI Test Status][ci-img]][ci-url] [![Code Climate][clim-img]][clim-url] -[![NPM][npm-img]][npm-url] - # haraka-plugin-helo.checks This plugin performs a number of checks on the HELO string. @@ -151,5 +149,3 @@ gmail.com=google.com [ci-url]: https://github.com/haraka/haraka-plugin-helo.checks/actions/workflows/ci.yml [clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-helo.checks/badges/gpa.svg [clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-helo.checks -[npm-img]: https://nodei.co/npm/haraka-plugin-helo.checks.png -[npm-url]: https://www.npmjs.com/package/haraka-plugin-helo.checks diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..d9aaa82 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,29 @@ +import globals from 'globals' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import js from '@eslint/js' +import { FlatCompat } from '@eslint/eslintrc' + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) + +export default [ + ...compat.extends('@haraka'), + { + languageOptions: { + globals: { + ...globals.node, + ...globals.mocha, + }, + }, + + rules: { + 'no-unused-vars': 1, + }, + }, +] diff --git a/index.js b/index.js index 18bb1c7..138e7c8 100644 --- a/index.js +++ b/index.js @@ -320,7 +320,7 @@ exports.big_company = function (next, connection, helo) { const allowed_rdns = this.cfg.bigco[helo].split(/,/) for (const allow of allowed_rdns) { - const re = new RegExp(`${allow.replace(/\./g, '\\.')}$`) + const re = new RegExp(`${allow.replaceAll('.', '\\.')}$`) if (re.test(rdns)) { connection.results.add(this, { pass: 'big_co' }) return next() diff --git a/package.json b/package.json index a5d47d5..3d2256f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "haraka-plugin-helo.checks", - "version": "1.0.1", + "version": "1.0.2", "description": "Haraka plugin checks the HELO string.", "main": "index.js", "files": [ @@ -9,8 +9,8 @@ ], "scripts": { "format": "npm run prettier:fix && npm run lint:fix", - "lint": "npx eslint@^8 *.js test", - "lint:fix": "npx eslint@^8 *.js test --fix", + "lint": "npx eslint@^9 *.js test", + "lint:fix": "npx eslint@^9 *.js test --fix", "prettier": "npx prettier . --check", "prettier:fix": "npx prettier . --write --log-level=warn", "test": "node --test", @@ -32,12 +32,16 @@ }, "homepage": "https://github.com/haraka/haraka-plugin-helo.checks#readme", "devDependencies": { - "@haraka/eslint-config": "1.1.5", + "@haraka/eslint-config": "^2.0.2", "haraka-test-fixtures": "1.3.8" }, "dependencies": { - "haraka-net-utils": "^1.7.0", - "haraka-tld": "^1.2.2", + "haraka-net-utils": "^1.7.1", + "haraka-tld": "^1.2.3", "haraka-utils": "^1.1.3" + }, + "prettier": { + "singleQuote": true, + "semi": false } -} \ No newline at end of file +} diff --git a/test/index.js b/test/index.js index 006f14c..65a49da 100644 --- a/test/index.js +++ b/test/index.js @@ -334,8 +334,8 @@ describe('helo.checks', () => { beforeEach(_set_up) it('pass, reject=false', (t, done) => { - const test_helo = 'yahoo.com' - this.connection.remote.host = 'yahoo.com' + const test_helo = 'yahoo.co.jp' + this.connection.remote.host = 'yahoo.co.jp' this.plugin.cfg.check.big_company = true this.plugin.cfg.reject.big_company = true this.plugin.big_company(