Skip to content

Commit

Permalink
Merge pull request #23 from theRAPTLab/dev-sri/build-config-fixes
Browse files Browse the repository at this point in the history
FIX: Relax excessive ESLint configuration rules
  • Loading branch information
benloh authored Jun 18, 2024
2 parents 6ae3d63 + d10d87d commit eb51cbd
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 266 deletions.
95 changes: 95 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*///////////////////////////////// ABOUT \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*\
eslint configuration for MEME
updated 2024-06-18
\*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ * /////////////////////////////////////*/

/// CONFIG BLOCKS /////////////////////////////////////////////////////////////
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/** base eslint configuration */
const CONFIG = {
'env': {
'browser': true,
'commonjs': true,
'es6': true,
'node': true
},
'plugins': ['import', 'prettier', 'react'],
'extends': ['airbnb', 'prettier'],
'globals': {
'PACKAGE_TITLE': 'readonly', // injected by webpack
'PACKAGE_VERSION': 'readonly', // injected by webpack
'PACKAGE_DESCRIPTION': 'readonly', // injected by webpack
'__static': 'readonly' // injected by webpack
},
'parserOptions': {
'ecmaVersion': 2020,
'ecmaFeatures': {
'jsx': true
},
'sourceType': 'module'
}
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/** relaxations of rules that we don't mind */
const INQ_RULES = {
'prettier/prettier': ['warn'],
'no-console': 'off',
'no-debugger': 'warn',
'no-alert': 'warn',
'spaced-comment': 'off',
'react/jsx-filename-extension': [
1,
{
'extensions': ['.js', '.jsx']
}
],
'no-unused-vars': 'off',
'arrow-body-style': 'off',
'camelcase': 'off',
'no-use-before-define': 'off',
'import/no-extraneous-dependencies': [
'error',
{
'devDependencies': true
}
],
'no-underscore-dangle': 'off',
'no-plusplus': 'off',
'prefer-const': 'off',
'one-var': 'off',
'prefer-destructuring': 'off',
'class-methods-use-this': 'off',
'import/prefer-default-export': 'off',
// habit rules warnings
'no-param-reassign': 'warn',
'no-shadow': 'warn',
'grouped-accessor-pairs': 'warn',
'import/no-duplicates': ['warn', { 'considerQueryString': true }],
'radix': 'as-needed'
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/** react rules that we don't like */
const REACT_ICKS = {
'react/no-unescaped-entities': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-one-expression-per-line': 'off',
// new with removal of prettier/react, which is now included in prettier
'react/no-unused-class-component-methods': 'off',
'react/no-unused-prop-types': 'warn',
'react/no-unused-state': 'warn',
'react/prop-types': 'warn',
'react/jsx-props-no-spreading': 'warn',
'react/no-array-index-key': 'warn'
};

/// EXPORTS ///////////////////////////////////////////////////////////////////
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
module.exports = {
...CONFIG, // base eslint config
rules: {
...INQ_RULES, // default inq styles
...REACT_ICKS
}
};
57 changes: 0 additions & 57 deletions .eslintrc.json

This file was deleted.

1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"ms-vsliveshare.vsliveshare",
"esbenp.prettier-vscode",
"stkb.rewrap"
],
Expand Down
Loading

0 comments on commit eb51cbd

Please sign in to comment.