```console $ npx mega-linter-runner -r v8 -f cupcake +----SUMMARY----+--------------------------+---------------+-------+-------+--------+----------+--------------+ | Descriptor | Linter | Mode | Files | Fixed | Errors | Warnings | Elapsed time | +---------------+--------------------------+---------------+-------+-------+--------+----------+--------------+ | ✅ ACTION | actionlint | list_of_files | 4 | | 0 | 0 | 3.25s | | ✅ BASH | bash-exec | file | 1 | | 0 | 0 | 2.77s | | ✅ BASH | shellcheck | list_of_files | 1 | | 0 | 0 | 1.16s | | ✅ BASH | shfmt | list_of_files | 1 | 0 | 0 | 0 | 0.6s | | ⚠️ COPYPASTE | jscpd | project | n/a | | 8 | 0 | 24.82s | | ⚠️ DOCKERFILE | hadolint | list_of_files | 1 | | 4 | 0 | 6.74s | | ⚠️ JAVASCRIPT | eslint | list_of_files | 15 | 0 | 1 | 0 | 11.04s | | ✅ JSON | jsonlint | list_of_files | 7 | | 0 | 0 | 4.76s | | ✅ JSON | npm-package-json-lint | project | n/a | | 0 | 0 | 3.26s | | ✅ JSON | prettier | list_of_files | 7 | 0 | 0 | 0 | 5.08s | | ✅ JSON | v8r | list_of_files | 7 | | 0 | 0 | 47.96s | | ✅ MARKDOWN | markdownlint | list_of_files | 2 | 0 | 0 | 0 | 12.16s | | ✅ MARKDOWN | markdown-table-formatter | list_of_files | 2 | 0 | 0 | 0 | 4.15s | | ⚠️ REPOSITORY | checkov | project | n/a | | 3 | 0 | 112.11s | | ✅ REPOSITORY | gitleaks | project | n/a | | 0 | 0 | 3.09s | | ✅ REPOSITORY | git_diff | project | n/a | | 0 | 0 | 1.22s | | ✅ REPOSITORY | grype | project | n/a | | 0 | 0 | 159.7s | | ⚠️ REPOSITORY | kics | project | n/a | | 24 | 0 | 14.82s | | ✅ REPOSITORY | secretlint | project | n/a | | 0 | 0 | 7.24s | | ✅ REPOSITORY | syft | project | n/a | | 0 | 0 | 7.83s | | ⚠️ REPOSITORY | trivy | project | n/a | | 2 | 0 | 28.16s | | ✅ REPOSITORY | trufflehog | project | n/a | | 0 | 0 | 26.51s | | ⚠️ SPELL | cspell | list_of_files | 40 | | 224 | 0 | 82.25s | | ⚠️ SPELL | lychee | list_of_files | 17 | | 9 | 0 | 10.28s | | ✅ YAML | prettier | list_of_files | 8 | 1 | 0 | 0 | 9.12s | | ✅ YAML | v8r | list_of_files | 8 | | 0 | 0 | 39.07s | | ✅ YAML | yamllint | list_of_files | 8 | | 0 | 0 | 5.39s | +---------------+--------------------------+---------------+-------+-------+--------+----------+--------------+ ```
79 lines
3.5 KiB
JavaScript
79 lines
3.5 KiB
JavaScript
// https://eslint.org/docs/latest/use/configure/configuration-files-new
|
|
// https://eslint.org/docs/latest/use/configure/migration-guide
|
|
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
import stylistic from '@stylistic/eslint-plugin-js';
|
|
|
|
export default [
|
|
// https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
// object with just `ignores` applies to all configuration objects
|
|
// had `ln -s .gitignore .eslintignore` before, but .eslintignore no longer supported
|
|
{
|
|
ignores: ['data/**', 'megalinter-reports/**'],
|
|
},
|
|
js.configs.recommended, // TODO still needed?
|
|
{
|
|
// files: ['*.js'],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
...globals.browser,
|
|
},
|
|
},
|
|
plugins: {
|
|
'@stylistic/js': stylistic,
|
|
},
|
|
// https://eslint.org/docs/latest/rules/
|
|
// https://eslint.style/packages/js
|
|
rules: {
|
|
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
'prefer-const': 'error',
|
|
'@stylistic/js/array-bracket-newline': ['error', 'consistent'],
|
|
'@stylistic/js/array-bracket-spacing': 'error',
|
|
'@stylistic/js/array-element-newline': ['error', 'consistent'],
|
|
'@stylistic/js/arrow-parens': ['error', 'as-needed'],
|
|
'@stylistic/js/arrow-spacing': 'error',
|
|
'@stylistic/js/block-spacing': 'error',
|
|
'@stylistic/js/brace-style': 'error',
|
|
'@stylistic/js/comma-dangle': ['error', 'always-multiline'],
|
|
'@stylistic/js/comma-spacing': 'error',
|
|
'@stylistic/js/comma-style': 'error',
|
|
'@stylistic/js/eol-last': 'error',
|
|
'@stylistic/js/func-call-spacing': 'error',
|
|
'@stylistic/js/function-paren-newline': ['error', 'consistent'],
|
|
'@stylistic/js/implicit-arrow-linebreak': 'error',
|
|
'@stylistic/js/indent': ['error', 2],
|
|
'@stylistic/js/key-spacing': 'error',
|
|
'@stylistic/js/keyword-spacing': 'error',
|
|
'@stylistic/js/linebreak-style': 'error',
|
|
'@stylistic/js/no-extra-parens': 'error',
|
|
'@stylistic/js/no-extra-semi': 'error',
|
|
'@stylistic/js/no-mixed-spaces-and-tabs': 'error',
|
|
'@stylistic/js/no-multi-spaces': 'error',
|
|
'@stylistic/js/no-multiple-empty-lines': 'error',
|
|
'@stylistic/js/no-tabs': 'error',
|
|
'@stylistic/js/no-trailing-spaces': 'error',
|
|
'@stylistic/js/no-whitespace-before-property': 'error',
|
|
'@stylistic/js/nonblock-statement-body-position': 'error',
|
|
'@stylistic/js/object-curly-newline': 'error',
|
|
'@stylistic/js/object-curly-spacing': ['error', 'always'],
|
|
'@stylistic/js/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
|
|
'@stylistic/js/quote-props': ['error', 'as-needed'],
|
|
'@stylistic/js/quotes': ['error', 'single'],
|
|
'@stylistic/js/rest-spread-spacing': 'error',
|
|
'@stylistic/js/semi': 'error',
|
|
'@stylistic/js/semi-spacing': 'error',
|
|
'@stylistic/js/semi-style': 'error',
|
|
'@stylistic/js/space-before-blocks': 'error',
|
|
'@stylistic/js/space-before-function-paren': ['error', { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
|
|
'@stylistic/js/space-in-parens': 'error',
|
|
'@stylistic/js/space-infix-ops': 'error',
|
|
'@stylistic/js/space-unary-ops': 'error',
|
|
'@stylistic/js/spaced-comment': 'error',
|
|
'@stylistic/js/switch-colon-spacing': 'error',
|
|
'@stylistic/js/template-curly-spacing': 'error',
|
|
'@stylistic/js/template-tag-spacing': 'error',
|
|
'@stylistic/js/wrap-regex': 'error',
|
|
},
|
|
},
|
|
];
|