| 
 | 1 | +/*!  | 
 | 2 | +This file is part of CycloneDX SBOM plugin for yarn.  | 
 | 3 | +
  | 
 | 4 | +Licensed under the Apache License, Version 2.0 (the "License");  | 
 | 5 | +you may not use this file except in compliance with the License.  | 
 | 6 | +You may obtain a copy of the License at  | 
 | 7 | +
  | 
 | 8 | +   http://www.apache.org/licenses/LICENSE-2.0  | 
 | 9 | +
  | 
 | 10 | +Unless required by applicable law or agreed to in writing, software  | 
 | 11 | +distributed under the License is distributed on an "AS IS" BASIS,  | 
 | 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  | 
 | 13 | +See the License for the specific language governing permissions and  | 
 | 14 | +limitations under the License.  | 
 | 15 | +
  | 
 | 16 | +SPDX-License-Identifier: Apache-2.0  | 
 | 17 | +Copyright (c) OWASP Foundation. All Rights Reserved.  | 
 | 18 | +*/  | 
 | 19 | + | 
 | 20 | +/* eslint-disable jsdoc/valid-types */  | 
 | 21 | + | 
 | 22 | +/**  | 
 | 23 | + * @type {import('eslint').Linter.Config}  | 
 | 24 | + * @see https://eslint.org/  | 
 | 25 | + */  | 
 | 26 | +module.exports = {  | 
 | 27 | +  root: true,  | 
 | 28 | +  plugins: [  | 
 | 29 | +    /* see https://github.com/lydell/eslint-plugin-simple-import-sort#readme */  | 
 | 30 | +    'simple-import-sort',  | 
 | 31 | +    /* see https://github.com/Stuk/eslint-plugin-header#readme */  | 
 | 32 | +    'header'  | 
 | 33 | +  ],  | 
 | 34 | +  env: {  | 
 | 35 | +    commonjs: true,  | 
 | 36 | +    node: true  | 
 | 37 | +  },  | 
 | 38 | +  rules: {  | 
 | 39 | +    // region sort imports/exports  | 
 | 40 | +    /** disable other sorters in favour of `simple-import-sort` */  | 
 | 41 | +    'import/order': 0,  | 
 | 42 | +    'sort-imports': 0,  | 
 | 43 | +    /** @see https://github.com/lydell/eslint-plugin-simple-import-sort/ */  | 
 | 44 | +    'simple-import-sort/imports': 'error',  | 
 | 45 | +    'simple-import-sort/exports': 'error',  | 
 | 46 | +    // endregion sort imports/exports  | 
 | 47 | +    // region license-header  | 
 | 48 | +    /* see https://github.com/Stuk/eslint-plugin-header#readme */  | 
 | 49 | +    'header/header': ['error', '.license-header.js']  | 
 | 50 | +    // endregion license-header  | 
 | 51 | +  },  | 
 | 52 | +  overrides: [  | 
 | 53 | +    {  | 
 | 54 | +      files: ['*.spec.*', '*.test.*'],  | 
 | 55 | +      env: {  | 
 | 56 | +        mocha: true,  | 
 | 57 | +        commonjs: true,  | 
 | 58 | +        node: true  | 
 | 59 | +      }  | 
 | 60 | +    },  | 
 | 61 | +    {  | 
 | 62 | +      files: ['*.ts'],  | 
 | 63 | +      extends: [  | 
 | 64 | +        /** @see https://github.com/standard/ts-standard */  | 
 | 65 | +        'standard-with-typescript'  | 
 | 66 | +      ],  | 
 | 67 | +      parserOptions: {  | 
 | 68 | +        project: './tsconfig.json'  | 
 | 69 | +      },  | 
 | 70 | +      rules: {  | 
 | 71 | +        /* @see https://typescript-eslint.io/rules/unbound-method/ */  | 
 | 72 | +        '@typescript-eslint/unbound-method': ['error', {  | 
 | 73 | +          ignoreStatic: true  | 
 | 74 | +        }]  | 
 | 75 | +      }  | 
 | 76 | +    },  | 
 | 77 | +    {  | 
 | 78 | +      files: ['*.js', '*.mjs', '*.cjs'],  | 
 | 79 | +      extends: [  | 
 | 80 | +        /* see https://www.npmjs.com/package/eslint-config-standard */  | 
 | 81 | +        'standard',  | 
 | 82 | +        /* see https://github.com/gajus/eslint-plugin-jsdoc */  | 
 | 83 | +        'plugin:jsdoc/recommended'  | 
 | 84 | +      ],  | 
 | 85 | +      plugins: [  | 
 | 86 | +        /* see https://github.com/gajus/eslint-plugin-jsdoc/ */  | 
 | 87 | +        'jsdoc'  | 
 | 88 | +      ],  | 
 | 89 | +      rules: {  | 
 | 90 | +        /* see https://github.com/gajus/eslint-plugin-jsdoc */  | 
 | 91 | +        'jsdoc/no-undefined-types': 'error',  | 
 | 92 | +        'jsdoc/check-tag-names': 0,  | 
 | 93 | +        'jsdoc/check-types': 'error',  | 
 | 94 | +        'jsdoc/require-hyphen-before-param-description': ['error', 'always'],  | 
 | 95 | +        'jsdoc/require-jsdoc': 0,  | 
 | 96 | +        'jsdoc/require-param': 0,  | 
 | 97 | +        'jsdoc/require-param-description': 0,  | 
 | 98 | +        'jsdoc/require-param-name': 'error',  | 
 | 99 | +        'jsdoc/require-param-type': 'error',  | 
 | 100 | +        'jsdoc/require-property': 0,  | 
 | 101 | +        'jsdoc/require-property-description': 0,  | 
 | 102 | +        'jsdoc/require-property-name': 'error',  | 
 | 103 | +        'jsdoc/require-property-type': 'error',  | 
 | 104 | +        'jsdoc/require-returns': 0,  | 
 | 105 | +        'jsdoc/require-returns-check': 'error',  | 
 | 106 | +        'jsdoc/require-returns-description': 0,  | 
 | 107 | +        'jsdoc/require-returns-type': 'error',  | 
 | 108 | +        'jsdoc/require-throws': 'error',  | 
 | 109 | +        'jsdoc/require-yields': 0,  | 
 | 110 | +        'jsdoc/require-yields-check': 'error',  | 
 | 111 | +        'jsdoc/sort-tags': 'warn'  | 
 | 112 | +        // region docs  | 
 | 113 | +      },  | 
 | 114 | +      settings: {  | 
 | 115 | +        jsdoc: {  | 
 | 116 | +          /* see https://github.com/gajus/eslint-plugin-jsdoc */  | 
 | 117 | +          mode: 'jsdoc'  | 
 | 118 | +        }  | 
 | 119 | +      }  | 
 | 120 | +    }  | 
 | 121 | +  ]  | 
 | 122 | +}  | 
0 commit comments