Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/increase entropy #8

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Test, Build and Publish.
on: [push]
jobs:
test:
strategy:
matrix:
version: [18, 20]
permissions:
packages: read
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: |
echo @92green:https://npm.pkg.github.com/ > ${GITHUB_WORKSPACE:-~}/.npmrc
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ${GITHUB_WORKSPACE:-~}/.npmrc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: NPM Install
run: npm install
env:
NPM_CONFIG_USERCONFIG: $GITHUB_WORKSPACE/.npmrc
NODE_ENV: "development"
- name: test
run: npm run test
env:
NODE_ENV: "development"
publish_pre_release:
needs: test
if: contains(github.ref, 'refs/heads/release')
strategy:
matrix:
version: [18]
permissions:
packages: write
id-token: write
contents: write
concurrency:
# pushes to same branch, to cancel out old actions
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.version }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: |
echo @92green:https://npm.pkg.github.com/ > ${GITHUB_WORKSPACE:-~}/.npmrc
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ${GITHUB_WORKSPACE:-~}/.npmrc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: NPM Install
run: npm install
env:
NPM_CONFIG_USERCONFIG: $GITHUB_WORKSPACE/.npmrc
NODE_ENV: "development"
- name: PreRelease
run: npx release-it --preRelease --ci
env:
NODE_ENV: "development"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_release:
needs: test
if: contains(github.ref, 'refs/heads/main')
strategy:
matrix:
version: [18]
permissions:
packages: write
id-token: write
contents: write
concurrency:
# pushes to same branch, to cancel out old actions
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.version }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: |
echo @92green:https://npm.pkg.github.com/ > ${GITHUB_WORKSPACE:-~}/.npmrc
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ${GITHUB_WORKSPACE:-~}/.npmrc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: NPM Install
run: npm install
env:
NPM_CONFIG_USERCONFIG: $GITHUB_WORKSPACE/.npmrc
NODE_ENV: "development"
- name: PreRelease
run: npx release-it --ci
env:
NODE_ENV: "development"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Empty file modified .husky/commit-msg
100644 → 100755
Empty file.
90 changes: 90 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,95 @@


## [2.1.0](https://github.com/danielc92/eslint-config-dc/compare/2.0.0...2.1.0) (2023-10-04)


### Features

* added github tokens pattern ([f9dd1bd](https://github.com/danielc92/eslint-config-dc/commit/f9dd1bd78891915f3ad56ff2156dc9bc17cc279b))
* eliminate some false positives in no-secrets ([70f33ce](https://github.com/danielc92/eslint-config-dc/commit/70f33ce56843b17fbcc4b5f29810a1fe22a2e5ce))

## [2.0.0](https://github.com/danielc92/eslint-config-dc/compare/1.18.0...2.0.0) (2023-08-24)


### ⚠ BREAKING CHANGES

* set indenting to 4, disable ASI and tidy curly newlines

### Features

* fix my terrible typing ([90e6f2f](https://github.com/danielc92/eslint-config-dc/commit/90e6f2f6f7c39319947cf35dfe37683f8b628efd))
* set indenting to 4, disable ASI and tidy curly newlines ([014c987](https://github.com/danielc92/eslint-config-dc/commit/014c9871986e4a16bc06b8d422f2236f60e8ddcd))
* update workflow and test ([02f961d](https://github.com/danielc92/eslint-config-dc/commit/02f961d06c31c0b0de10c3cc52d0efdff82bb858))

## [1.18.0](https://github.com/danielc92/eslint-config-dc/compare/1.18.0-3...1.18.0) (2023-08-23)

## 1.18.0-3 (2023-06-29)


### Features

* add multiline-expression ([7eb08e6](https://github.com/danielc92/eslint-config-dc/commit/7eb08e62bffca46fb44d0c4c7f0ba44648bfdee1))
* add to 92green package repository ([4081242](https://github.com/danielc92/eslint-config-dc/commit/40812429955688172712d0409ffd03502d7cdfbc))
* added brace,comma/object rules ([be8d065](https://github.com/danielc92/eslint-config-dc/commit/be8d0654af4b850da0c6e0f6b80d65c93464021d))
* added few more jest rules ([43493b9](https://github.com/danielc92/eslint-config-dc/commit/43493b9f833a051c496025bfe74bc4082a48aa0e))
* added more rules, written tests ([1a04233](https://github.com/danielc92/eslint-config-dc/commit/1a04233616ab692fa866ea717c687346379fc370))
* added more spacing rules ([6864d80](https://github.com/danielc92/eslint-config-dc/commit/6864d806d307cdc0a6585993484cff33e3e7548c))
* added more spacing rules ([909af6f](https://github.com/danielc92/eslint-config-dc/commit/909af6f7e1925a2d7a42b0b3bcd9401f23b933a2))
* added some more layout rules ([b3fbf1b](https://github.com/danielc92/eslint-config-dc/commit/b3fbf1bce09606c6cc9dd215b837b67d38315285))
* added support for jestdom plugin ([09202ca](https://github.com/danielc92/eslint-config-dc/commit/09202cac9c2286eb204dbd84d7b376d5886a187d))
* adjusted object-curly-newline ([769d695](https://github.com/danielc92/eslint-config-dc/commit/769d6954fce43cc2860b6d9a53a7220598634698))
* broaden enum rules ([7a0acf2](https://github.com/danielc92/eslint-config-dc/commit/7a0acf20332f3a7277bd44efafbce87d345b04aa))
* broaden test file glob ([6759a45](https://github.com/danielc92/eslint-config-dc/commit/6759a45767292b45b4ccb5e5315fbbf250c5503c))
* broaden typescript-eslint warnings ([041faff](https://github.com/danielc92/eslint-config-dc/commit/041faffaf3cd9e43f9660aa3dcb8cd19aa3f6684))
* consistent react handler function names ([c56b262](https://github.com/danielc92/eslint-config-dc/commit/c56b262549ccffc5fa896b8353c724a47bf373ce))
* improved testing and added import plugin ([415c119](https://github.com/danielc92/eslint-config-dc/commit/415c1196fb11f20e61a97e103e9c8f16161aa0a2))
* init ([6f34c7a](https://github.com/danielc92/eslint-config-dc/commit/6f34c7a9bf4b4dbcc99fed4cdf30d06a8afc7a45))
* minor changes to config ([828693c](https://github.com/danielc92/eslint-config-dc/commit/828693c2b82ad50a24ae97aa071eb53a11a0fb57))
* promise plugin ([e10d68b](https://github.com/danielc92/eslint-config-dc/commit/e10d68b14fe61ad4a0ab4ca894bff5e8ae41f847))
* react conf ([4e1ce1a](https://github.com/danielc92/eslint-config-dc/commit/4e1ce1ae0524f87fa26c2e5fc82e529fdca7915e))
* readme ([51af4d7](https://github.com/danielc92/eslint-config-dc/commit/51af4d71a1e045547d6c53965b22de0342a01b21))
* rearrange deps for yarn install ([6a4785e](https://github.com/danielc92/eslint-config-dc/commit/6a4785e75178f175f5920fc8f15de5fc3b10daef))
* rename ([a4c3a22](https://github.com/danielc92/eslint-config-dc/commit/a4c3a228720fb5be58c16355536a8c13c877a758))
* rxjs addon ([e5f4ed8](https://github.com/danielc92/eslint-config-dc/commit/e5f4ed8e512128afdc5f0347ad4d1f20a09c2b38))
* update sandbox ([e194374](https://github.com/danielc92/eslint-config-dc/commit/e1943744c2d42806495d0e60b82410cfc4e0fdb8))
* update sandbox ([f6397e1](https://github.com/danielc92/eslint-config-dc/commit/f6397e14fe3e7c02ecb74e18a54bb68f513caf21))
* updated array rules ([c148f12](https://github.com/danielc92/eslint-config-dc/commit/c148f126e177534c5fc65e94b428a7c40dc086ac))
* vscode setting for autosaving ([2ac7738](https://github.com/danielc92/eslint-config-dc/commit/2ac7738fe50343e71d5a6cdead3289e49073bf4b))


### Bug Fixes

* added pii plugin ([ab7dd4c](https://github.com/danielc92/eslint-config-dc/commit/ab7dd4c1cb4bcccae385ceb642a91843a0f96130))
* conflicts with jsx expression indent been resolved ([6dab899](https://github.com/danielc92/eslint-config-dc/commit/6dab899162551ab272cfc658ae3f509e43af4a6f))
* fix conflicts with indent in react ([4980019](https://github.com/danielc92/eslint-config-dc/commit/4980019cfc094c22d84442e5bed25bc9f6c322ca))
* missing file ([854f857](https://github.com/danielc92/eslint-config-dc/commit/854f857ab15d4ddaa74ed6cc95ab3f8107332e5d))
* multiple statements combining on same line ([b38802b](https://github.com/danielc92/eslint-config-dc/commit/b38802b2005916f946622ed715d8ae63bc30326d))
* prepub script ([7bc33c5](https://github.com/danielc92/eslint-config-dc/commit/7bc33c59b5425bc3bd936b81256363964129d872))
* reduce padding-line-between-statements rules ([ea5e462](https://github.com/danielc92/eslint-config-dc/commit/ea5e4626e81b20a8ceae917d1275977b37937788))
* removed unwanted files from tarball ([40cacd1](https://github.com/danielc92/eslint-config-dc/commit/40cacd1185c35e9d60c504c9fafd001045bc4ca6))


### Maintenance

* add maintenance to release config ([5e87a32](https://github.com/danielc92/eslint-config-dc/commit/5e87a32d402b8812aa91260b21b48488304ac6d7))
* added unit tests for addons ([8e5f77e](https://github.com/danielc92/eslint-config-dc/commit/8e5f77ecd191e3ad905750f3a05dd292fa092aee))
* configure release-it husky ([93bb5cb](https://github.com/danielc92/eslint-config-dc/commit/93bb5cba6c0cfe870cf0298ad29d3db9f032ca80))
* improved maintainability of tests ([3b6c69f](https://github.com/danielc92/eslint-config-dc/commit/3b6c69f997f04e772e81447beaf17fb4ed3b0238))
* npm maintenance ([45f12ed](https://github.com/danielc92/eslint-config-dc/commit/45f12ed644a485c57d69b0c22eb0912f1c3ab7e1))
* prepare script ([151dad9](https://github.com/danielc92/eslint-config-dc/commit/151dad9a70d1aff685855213b919c99386a66082))
* release v1.14.3 ([9e0a3cd](https://github.com/danielc92/eslint-config-dc/commit/9e0a3cd324b0ba7ea07b5608858f119a3a227ec7))
* release v1.14.4 ([2e08aed](https://github.com/danielc92/eslint-config-dc/commit/2e08aed3e5afe737b0bead9bbedc643b3be9ba30))
* release v1.15.0 ([3ca3b38](https://github.com/danielc92/eslint-config-dc/commit/3ca3b385a2c20c41e3751d864b88630d65fadfd0))
* release v1.15.1 ([09c4446](https://github.com/danielc92/eslint-config-dc/commit/09c44464ed1c3f824092b40e30925e252b4cfa4f))
* release v1.15.2 ([6b484f4](https://github.com/danielc92/eslint-config-dc/commit/6b484f40a317cce097f68205f9ea6a83b1e71ca4))
* release v1.16.0 ([9f3cfb9](https://github.com/danielc92/eslint-config-dc/commit/9f3cfb9550f5708e68926a537b3b88901f420f8d))
* release v1.17.0 ([d0c1aec](https://github.com/danielc92/eslint-config-dc/commit/d0c1aec1a15ce59eab1cfab7daf0c87892ddcf0e))
* release v1.17.1 ([7fe6759](https://github.com/danielc92/eslint-config-dc/commit/7fe6759520fcdd2405561c07731ce1f231e17ecb))
* release v1.17.2 ([b337b9f](https://github.com/danielc92/eslint-config-dc/commit/b337b9fb659a0b91431e40aa07b19ddda1ed40e9))
* test promise plugin ([c3432fc](https://github.com/danielc92/eslint-config-dc/commit/c3432fce354d74d60122b503242bf3463e9050ed))
* update packages ([de0ed6e](https://github.com/danielc92/eslint-config-dc/commit/de0ed6e53b9fb4c6e2645debc15d6ec5721a351a))
* update test ([e014961](https://github.com/danielc92/eslint-config-dc/commit/e014961b0141855c8aa7bfbf8d75b3648e0a90bf))

## [1.17.2](https://github.com/danielc92/eslint-config-dc/compare/v1.17.1...v1.17.2) (2023-06-10)


Expand Down
39 changes: 22 additions & 17 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,18 @@ module.exports = {
'import/exports-last': 'warn',

// SECURITY: SECRETS (ZERO TOLERANCE)
'no-secrets/no-secrets': 'error',
'no-secrets/no-secrets': ["error",{
// note: default is 4
"tolerance":4.2,
"additionalRegexes": {
// source https://gist.github.com/magnetikonline/073afe7909ffdd6f10ef06a00bc3bc88#combined-together
"Github tokens": "^(gh[ps]_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})$",
"Basic Auth": "Authorization: Basic [A-Za-z0-9+/=]*",

},
// ignore uuid pattern
"ignoreContent": "^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$"
}],

// CODE QUALITY: SONARJS (ZERO TOLERANCE)
'sonarjs/cognitive-complexity': 'error',
Expand Down Expand Up @@ -135,7 +146,8 @@ module.exports = {
'no-lonely-if': 'warn',
'eqeqeq': 'warn',
'no-new-wrappers': 'warn',
'no-plusplus': 'warn',
// Semis are required so we are not concerned with ASI
'no-plusplus': 'off',
'no-return-await': 'warn',
'no-throw-literal': 'warn',
'no-nested-ternary': 'warn',
Expand All @@ -155,7 +167,7 @@ module.exports = {
'multiline-ternary': [ 'warn', 'always' ],
'indent': [
'warn',
3,
4,
{
'SwitchCase': 1,
'ignoredNodes': [
Expand Down Expand Up @@ -186,7 +198,8 @@ module.exports = {
}
],
'no-multiple-empty-lines': [ 'warn', { max: 1 } ],
'semi': [ 'warn', 'always' ],
// Prevent ASI
'semi': [ 'error', 'always' ],
'no-multi-spaces': 'warn',
'space-in-parens': [ 'warn', 'never' ],
'semi-spacing': 'warn',
Expand Down Expand Up @@ -243,20 +256,12 @@ module.exports = {
'comma-style': [ 'warn', 'last' ],
'object-property-newline': [ 'warn', { 'allowAllPropertiesOnSameLine': false } ],
'object-curly-newline': [
'warn',
{
'ObjectExpression': { 'minProperties': 2 },
'ObjectPattern': { 'multiline': true },
'ImportDeclaration': {
'multiline': true,
'minProperties': 4
},
'ExportDeclaration': {
'multiline': true,
'minProperties': 4
"warn", {
"ObjectExpression": { "multiline": true, "minProperties": 3, "consistent": true },
"ObjectPattern": { "multiline": true, "minProperties": 3, "consistent": true },
"ExportDeclaration": { "multiline": true, "minProperties": 3 }
}
}
],
],
'brace-style': [ 'warn', '1tbs', { allowSingleLine: false } ],
'max-statements-per-line': [ 'warn', { 'max': 1 } ],
'lines-between-class-members': [ 'warn', 'always', { 'exceptAfterSingleLine': true } ],
Expand Down
18 changes: 13 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 17 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"name": "eslint-config-platypus",
"version": "1.17.2",
"name": "@92green/eslint-config-platypus",
"version": "2.1.0",
"description": "reusable linting config for eslint",
"main": "main.js",
"repository": {
"type": "git",
"url": "git+https://github.com/danielc92/eslint-config-dc.git"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"scripts": {
"release": "release-it",
"test": "jest",
"prepublishOnly": "npm run test"
"prepublishOnly": "npm run test",
"prepare": "husky install"
},
"files": [
"LICENSE",
Expand All @@ -30,7 +34,15 @@
},
"homepage": "https://github.com/danielc92/eslint-config-dc#readme",
"peerDependencies": {
"eslint": ">= 8"
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"eslint": ">= 8",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-no-secrets": "^0.8.9",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-sonarjs": "^0.19.0"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.59.9",
Expand Down Expand Up @@ -76,7 +88,7 @@
"release": true
},
"npm": {
"publish": false
"publish": true
},
"plugins": {
"@release-it/conventional-changelog": {
Expand Down
Loading