Skip to content

Commit

Permalink
chore(tools): eslint standards (#879)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump eslint-config-standard-with-typescript

Bumps [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript) from 35.0.0 to 36.0.0.
- [Release notes](https://github.com/standard/eslint-config-standard-with-typescript/releases)
- [Changelog](https://github.com/standard/eslint-config-standard-with-typescript/blob/master/CHANGELOG.md)
- [Commits](mightyiam/eslint-config-love@v35.0.0...v36.0.0)

---
updated-dependencies:
- dependency-name: eslint-config-standard-with-typescript
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: use updated code styles and eslint standards

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
jkowalleck and dependabot[bot] authored Jul 1, 2023
1 parent 3b620aa commit 91e0474
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 62 deletions.
98 changes: 51 additions & 47 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,34 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
*/
module.exports = {
root: true,
extends: [
/* see https://github.com/standard/ts-standard */
'standard-with-typescript'
],
parserOptions: {
project: './tsconfig.json'
},
plugins: [
/* see https://github.com/lydell/eslint-plugin-simple-import-sort#readme */
'simple-import-sort',
/* see https://github.com/Stuk/eslint-plugin-header#readme */
'header',
/* see https://github.com/microsoft/tsdoc */
'eslint-plugin-tsdoc'
'header'
],
env: {
commonjs: true,
browser: true,
node: true
},
rules: {
// region sort imports/exports
/* disable other sorters in favour of `simple-import-sort` */
'import/order': 0,
'sort-imports': 0,
/* see https://github.com/lydell/eslint-plugin-simple-import-sort/ */
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
// endregion sort imports/exports
// region license-header
/* see https://github.com/Stuk/eslint-plugin-header#readme */
'header/header': ['error', './.license-header.js']
// endregion license-header
},
overrides: [
{
files: [
'*.spec.*',
'*.test.*'
],
files: ['*.spec.*', '*.test.*'],
env: {
mocha: true,
commonjs: true,
Expand All @@ -59,18 +61,47 @@ module.exports = {
}
},
{
files: ['*.js', '*.mjs', '*.cjs'],
files: ['*.ts'],
extends: [
/* see https://github.com/standard/ts-standard */
'standard-with-typescript'
],
plugins: [
/* see https://github.com/gajus/eslint-plugin-jsdoc/ */
'jsdoc'
/* see https://github.com/microsoft/tsdoc */
'eslint-plugin-tsdoc'
],
parserOptions: {
project: './tsconfig.json'
},
rules: {
// region override rules from plugin 'standard-with-typescript'
/* @see https://typescript-eslint.io/rules/consistent-type-imports/ */
'@typescript-eslint/consistent-type-imports': ['error', {
/* we need our generated declaration files backward compatible to TS3.8
* see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html
*/
fixStyle: 'separate-type-imports'
}],
// endregion override rules from plugin 'standard-with-typescript'
// region docs
/* see https://github.com/microsoft/tsdoc */
'tsdoc/syntax': 'error'
// endregion docs
}
},
{
files: ['*.js', '*.mjs', '*.cjs'],
extends: [
/* see https://www.npmjs.com/package/eslint-config-standard */
'standard',
/* see https://github.com/gajus/eslint-plugin-jsdoc */
'plugin:jsdoc/recommended'
],
plugins: [
/* see https://github.com/gajus/eslint-plugin-jsdoc/ */
'jsdoc'
],
rules: {
// region docs
'tsdoc/syntax': 0,
/* see https://github.com/gajus/eslint-plugin-jsdoc */
'jsdoc/no-undefined-types': 'error',
'jsdoc/check-tag-names': 0,
Expand Down Expand Up @@ -102,32 +133,5 @@ module.exports = {
}
}
}
],
rules: {
// region override rules from plugin 'standard-with-typescript'
/* @see https://typescript-eslint.io/rules/consistent-type-imports/ */
'@typescript-eslint/consistent-type-imports': ['error', {
/* we need our generated declaration files backward compatible to TS3.8
* see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html
*/
fixStyle: 'separate-type-imports'
}],
// endregion override rules from plugin 'standard-with-typescript'
// region sort imports/exports
/* disable other sorters in favour of `simple-import-sort` */
'import/order': 0,
'sort-imports': 0,
/* see https://github.com/lydell/eslint-plugin-simple-import-sort/ */
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
// endregion sort imports/exports
// region docs
/* see https://github.com/microsoft/tsdoc */
'tsdoc/syntax': 'error',
// endregion docs
// region license-header
/* see https://github.com/Stuk/eslint-plugin-header#readme */
'header/header': ['error', '.license-header.js']
// endregion license-header
}
]
}
67 changes: 53 additions & 14 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"c8": "^8.0.0",
"deepmerge": "^4.2.2",
"eslint": "^8.23.0",
"eslint-config-standard-with-typescript": "^35.0.0",
"eslint-config-standard": "^17.1.0",
"eslint-config-standard-with-typescript": "^36.0.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-jsdoc": "^46.2.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
Expand Down

0 comments on commit 91e0474

Please sign in to comment.