diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 891594a..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "extends": [], - "env": { - "browser": true - }, - "parserOptions": { - "sourceType": "module", - "ecmaVersion": 2015 - }, - "globals": { - "jasmine": false, - "beforeEach": false, - "describe": false, - "expect": false, - "spyOn": false, - "it": false - }, - "rules": { - "global-require": 0, - "no-sequences": 0, - "semi": [2, "never"], - "strict": [2, "never"], - "one-var": [2, { - "let": "always", - "const": "never" - }], - "space-in-parens": [2, "never" ], - "indent": [2, 2, { - "flatTernaryExpressions": true, - "VariableDeclarator": { - "let": 2, - "const": 3 - } - }], - "camelcase": [2, {"properties": "never"}], - "func-names": [2, "never"], - "newline-per-chained-call": 0, - "max-len": [2, 80], - "comma-dangle": [2, "never"], - "prefer-template": 0, - "no-use-before-define": 0, - "no-mixed-operators": 0, - "no-plusplus": 0, - "no-console": 0, - "object-curly-newline": 0, - "nonblock-statement-body-position": 0, - "arrow-parens": [2, "as-needed"], - "space-before-function-paren": [2, "always"], - "function-paren-newline": 0, - "consistent-return": 0, - "array-callback-return": 0, - "prefer-const": 0, - "curly": 0, - "operator-linebreak": 0, - "no-param-reassign": 0, - "key-spacing": [2, {"beforeColon": true}], - "implicit-arrow-linebreak": 0, - "no-shadow": [0, "warn", { - "allow": [ "err" ] - } - ], - "prefer-arrow-callback": [2, { - "allowNamedFunctions": true - }], - "no-return-assign": 0, - "no-nested-ternary": 0, - "array-bracket-spacing": [2, "always"], - "prefer-destructuring": 2, - "class-methods-use-this": 0, - "no-confusing-arrow": 0 - } -} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a88c746..56e7174 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,13 +7,11 @@ on: branches: [ main ] jobs: - build: + lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: lint - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 with: - node-version: '20.x' + node-version: 22 - run: npm install - run: npm run lint diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 22ecb0f..14e9a95 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,12 +8,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 with: - node-version: 20 + node-version: 22 - run: npm install - - run: npm run build --if-present - run: npm run test # publish-npm: @@ -34,10 +32,10 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 registry-url: https://npm.pkg.github.com/ - name: Insert repository owner as scope into package name run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7a3b40a..6bb76f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: tests +name: test on: push: @@ -10,11 +10,8 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 with: - node-version: 20 + node-version: 22 - run: npm install - - run: npm run build --if-present - run: npm test diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a13bc7..5a28470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 6.1.5 - 2024-04-29 + +* [update eslint to version 9](https://github.com/iambumblehead/form-urlencoded/pull/54) + ## 6.1.4 - 2023-09-24 * [switch primary branch to 'main'](https://github.com/iambumblehead/form-urlencoded/pull/53) diff --git a/README.md b/README.md index a5dd40a..6579fb2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ form-urlencoded =============== **(c)[Bumblehead][0], [JBlashill][6]** -[![npm version](https://badge.fury.io/js/form-urlencoded.svg)](https://badge.fury.io/js/form-urlencoded) [![Build Status](https://github.com/iambumblehead/form-urlencoded/workflows/nodejs-ci/badge.svg)][2] +[![npm version](https://badge.fury.io/js/form-urlencoded.svg)](https://badge.fury.io/js/form-urlencoded) [![Build Status](https://github.com/iambumblehead/form-urlencoded/workflows/test/badge.svg)][2] Returns 'x-www-form-urlencoded' string data, an encoding often used when an [HTML form is submitted][1]. Form data is serialised in [this format][2] and sent to a server. diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..7786f75 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,70 @@ +const js = require('@eslint/js') + +module.exports = [ + js.configs.recommended, + { + ignores: [], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + globals: { + Set: true, + console: true + } + }, + rules: { + "global-require": 0, + "no-sequences": 0, + "semi": [2, "never"], + "strict": [2, "never"], + "one-var": [2, { + "let": "always", + "const": "never" + }], + "space-in-parens": [2, "never" ], + "indent": [2, 2, { + "flatTernaryExpressions": true, + "VariableDeclarator": { + "let": 2, + "const": 3 + } + }], + "camelcase": [2, {"properties": "never"}], + "func-names": [2, "never"], + "newline-per-chained-call": 0, + "max-len": [2, 80], + "comma-dangle": [2, "never"], + "prefer-template": 0, + "no-use-before-define": 0, + "no-mixed-operators": 0, + "no-plusplus": 0, + "no-console": 0, + "object-curly-newline": 0, + "nonblock-statement-body-position": 0, + "arrow-parens": [2, "as-needed"], + "space-before-function-paren": [2, "always"], + "function-paren-newline": 0, + "consistent-return": 0, + "array-callback-return": 0, + "prefer-const": 0, + "curly": 0, + "operator-linebreak": 0, + "no-param-reassign": 0, + "key-spacing": [2, {"beforeColon": true}], + "implicit-arrow-linebreak": 0, + "no-shadow": [0, "warn", { + "allow": [ "err" ] + } + ], + "prefer-arrow-callback": [2, { + "allowNamedFunctions": true + }], + "no-return-assign": 0, + "no-nested-ternary": 0, + "array-bracket-spacing": [2, "always"], + "prefer-destructuring": 2, + "class-methods-use-this": 0, + "no-confusing-arrow": 0 + } + } +] diff --git a/package.json b/package.json index 0f963b3..311c145 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "require": "./form-urlencoded.js", "import": "./form-urlencoded.mjs" }, - "version": "6.1.4", + "version": "6.1.5", "description": "Return an object as an 'x-www-form-urlencoded' string", "author": "Chris ", "license": "MIT", @@ -48,7 +48,7 @@ "json encode" ], "devDependencies": { - "eslint": "^7.26.0" + "eslint": "^9.1.1" }, "scripts": { "test": "npm start && node --test form-urlencoded.spec.mjs",