Skip to content

Instantly share code, notes, and snippets.

@brettz9
Last active February 26, 2020 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettz9/d473b8435e97abc5a4fae61f12e095bb to your computer and use it in GitHub Desktop.
Save brettz9/d473b8435e97abc5a4fae61f12e095bb to your computer and use it in GitHub Desktop.
Disabling of mostly stylistic rules when applying eslint-config-ash-nazg (for linting other projects or node_modules); should split these out within ash-nazg; also has overrides used for linting others' projects
# dist
# very unfortunately, it seems this can't be overridden apparently
# per https://eslint.org/docs/user-guide/configuring
# "ESLint always ignores files in /node_modules/* and /bower_components/*"
!node_modules
!.eslintrc.js
!.eslintrc-script.js
// Todo: Make a binary (and package.json)
// Call like this: eslint --config=../.eslintrc-script.js --no-eslintrc --no-inline-config .
'use strict';
module.exports = {
// Though not allowable with script, adding to avoid errors
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
extends: [
'.eslintrc.js', 'plugin:node/recommended-script'
],
overrides: [
{
files: 'eslint-plugin-jsdoc/**',
parser: 'babel-eslint',
plugins: [
// For eslint-plugin-jsdoc
'flowtype',
'fp',
'sort-keys-fix'
],
rules: {
'import/no-dynamic-require': 0, // Convenience to build from rules
// Ignore
'no-sync': 0,
'no-shadow': 0, // `context` as a Mocha global
'unicorn/no-process-exit': 0,
'jsdoc/require-param': 0, // Using Flow instead
// Might actually disable if ever need its linting in browser
'compat/compat': 0
}
}
],
rules: {
'no-process-exit': 0, // Re-added by recommended-script
'import/no-commonjs': 0,
'node/no-unsupported-features/es-syntax': ['error', {
ignores: ['modules']
}]
}
};
// Todo: Make a binary (and package.json)
// Call like this: eslint --config=../.eslintrc.js --no-eslintrc --no-inline-config .
'use strict';
module.exports = {
ignorePatterns: [
// 'dist',
'!node_modules',
'!.eslintrc.js'
],
extends: [
'ash-nazg/sauron-node'
],
settings: {
jsdoc: {
// Unset
preferredTypes: null
}
},
overrides: [
{
files: [
'**/eslint-plugin-chai-as-promised/**',
'**/eslint-plugin-mocha-cleanup/**'
],
extends: [
'plugin:node/recommended-script'
],
rules: {
'import/no-commonjs': 0
}
},
{
files: [
'**/eslint-plugin-mocha-cleanup/**'
],
rules: {
'jsdoc/check-tag-names': 0,
'no-var': 0
}
},
{
files: '**/dist/**',
extends: [
'plugin:node/recommended-script'
],
rules: {
// Disabling (though really shouldn't) per problematic cases: https://github.com/mozilla/eslint-plugin-no-unsanitized/issues/113
'no-unsanitized/method': 0,
'no-process-exit': 0, // Re-added by recommended-script
'wrap-iife': 0,
strict: 0,
'prefer-const': 0
}
},
{
files: ['.eslintrc.js', '.eslintrc-script.js'],
extends: [
'plugin:node/recommended-script'
],
rules: {
'import/no-commonjs': 0
}
},
{
files: '**/test/**',
env: {
mocha: true
}
}
],
rules: {
// Stylistic only
'unicorn/no-for-loop': 0,
'no-mixed-requires': 0,
'import/order': 0,
'brace-style': 0,
'comma-dangle': 0,
'import/extensions': 0,
'import/no-anonymous-default-export': 0,
'node/file-extension-in-import': 0,
'multiline-ternary': 0,
'no-multiple-empty-lines': 0,
'operator-linebreak': 0,
'arrow-parens': 0,
'object-curly-spacing': 0,
'space-before-function-paren': 0,
'jsdoc/match-description': 0,
'prefer-destructuring': 0,
'array-bracket-newline': 0,
'eslint-comments/no-unused-disable': 0,
'spaced-comment': 0,
'jsdoc/require-jsdoc': 0,
'jsdoc/require-returns': 0,
'node/exports-style': 0,
'eol-last': 0,
'no-void': 0,
'block-spacing': 0,
'function-paren-newline': 0,
'generator-star-spacing': 0,
'unicorn/new-for-builtins': 0,
'promise/prefer-await-to-then': 0,
'promise/avoid-new': 0,
'no-undef-init': 0,
'object-shorthand': 0,
'prefer-spread': 0,
'prefer-rest-params': 0,
'unicorn/prefer-reflect-apply': 0,
'consistent-this': 0,
'padded-blocks': 0,
'import/no-named-default': 0,
'global-require': 0,
'no-console': 0,
'quote-props': 0,
'unicorn/prefer-includes': 0,
'no-implicit-coercion': 0,
camelcase: 0,
quotes: 0,
indent: 0,
'import/newline-after-import': 0,
'jsdoc/require-property': 0,
'unicorn/prefer-string-slice': 0,
// Not of concern (as in Babel) when there is a `then(null, catcher)`
'promise/catch-or-return': ['error', {allowThen: true}],
// Todo: Should investigate why failing in dist:
'no-unsafe-finally': 0, // Babel?
'no-loop-func': 0, // Babel?
// Somewhat helpful, but not critical
'no-var': 0, // Actually could be a problem in overriding globals
'no-shadow': 0,
'vars-on-top': 0,
'no-func-assign': 0,
'no-process-env': 0,
'no-process-exit': 0,
'eslint-comments/disable-enable-pair': 0,
'func-name-matching': 0, // Not sure why Babel violates with `_createSymbol`
'block-scoped-var': 0,
'@mysticatea/block-scoped-var': 0,
'consistent-return': 0,
'dot-notation': 0,
'import/unambiguous': 0,
'no-eq-null': 0,
'default-param-last': 0,
'unicorn/no-unsafe-regex': 0,
'default-case': 0,
'wrap-regex': 0,
'require-unicode-regexp': 0,
'prefer-named-capture-group': 0,
'unicorn/escape-case': 0,
'no-empty-function': 0,
// Might want to apply sometimes
'no-mixed-operators': 0,
'unicorn/no-fn-reference-in-iterator': 0,
'max-len': 0
}
};
{
"private": true,
"author": "Brett Zamir",
"contributors": [],
"name": "home-directory",
"version": "0.0.0",
"description": "For holding npm packages that wish to run across projects (like ESLint)",
"keywords": [
"linting"
],
"repository": "https://gist.github.com/d473b8435e97abc5a4fae61f12e095bb",
"homepage": "https://gist.github.com/d473b8435e97abc5a4fae61f12e095bb",
"bugs": "https://gist.github.com/brettz9/d473b8435e97abc5a4fae61f12e095bb",
"license": "MIT",
"dependencies": {},
"engines": {
"node": ">=0.1.14"
},
"devDependencies": {
"@mysticatea/eslint-plugin": "^13.0.0",
"babel-eslint": "^10.0.3",
"eslint": "^6.8.0",
"eslint-config-ash-nazg": "^17.2.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-array-func": "^3.1.3",
"eslint-plugin-compat": "^3.5.1",
"eslint-plugin-eslint-comments": "^3.1.2",
"eslint-plugin-flowtype": "^4.6.0",
"eslint-plugin-fp": "^2.3.0",
"eslint-plugin-html": "^6.0.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsdoc": "^21.0.0",
"eslint-plugin-markdown": "^1.0.1",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-no-use-extend-native": "^0.4.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-sonarjs": "^0.5.0",
"eslint-plugin-sort-keys-fix": "^1.1.0",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-unicorn": "^16.1.1",
"typescript": "^3.8.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment