Skip to content

Commit

Permalink
chore(Linting): Update eslint configuration and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bamdadfr committed Apr 17, 2024
1 parent ca38c20 commit 8f3d75d
Show file tree
Hide file tree
Showing 3 changed files with 384 additions and 541 deletions.
170 changes: 169 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,171 @@
'use strict';

module.exports = {
extends: '@bamdadsabbagh/eslint-config',
env: {
browser: true,
node: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
requireConfigFile: false,
sourceType: 'module',
},
extends: [
'eslint:recommended',
'airbnb',
'plugin:jsx-a11y/recommended',
'prettier',
'plugin:jsdoc/recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: [
'@babel',
'jsx-a11y',
'prettier',
'jsdoc',
'react-hooks',
'testing-library',
'jest-dom',
'simple-import-sort',
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
// .jsx rules
'react/jsx-filename-extension': [
1,
{extensions: ['.js', '.jsx', '.ts', '.tsx']},
],
'import/extensions': 'off',
'react/jsx-indent': ['error', 2],
'react/prop-types': 'off',
'react-hooks/rules-of-hooks': ['error'],
'react-hooks/exhaustive-deps': ['warn'],
// .js rules
'strict': 'off',
'semi': ['error', 'always'],
'indent': [
'error',
2,
{
ignoredNodes: ['JSXElement'],
SwitchCase: 1,
},
],
'init-declarations': 'off',
'no-undef-init': 'off',
'comma-dangle': ['error', 'always-multiline'],
'brace-style': ['error', '1tbs'],
'multiline-comment-style': ['error', 'separate-lines'],
'dot-notation': 'off',
'quote-props': ['error', 'consistent'],
'no-multi-spaces': ['error', {ignoreEOLComments: true}],
'no-whitespace-before-property': 'error',
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'no-spaced-func': 'off',
'func-call-spacing': ['error', 'never'],
'func-names': 'off',
'block-spacing': ['error', 'always'],
'keyword-spacing': ['error', {before: true, after: true}],
'object-curly-spacing': ['error', 'never'],
'object-curly-newline': ['error', {consistent: true}],
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'space-in-parens': 'error',
'no-nested-ternary': 'error',
'padded-blocks': ['error', 'never'],
'eol-last': ['error', 'always'],
'semi-style': ['error', 'last'],
'eqeqeq': 'error',
'quotes': ['error', 'single', {avoidEscape: true}],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'new-parens': 'error',
'new-cap': ['error'],
'no-var': 'error',
'prefer-const': [
'error',
{
destructuring: 'any',
ignoreReadBeforeAssign: false,
},
],
'no-warning-comments': ['warn', {terms: ['fixme']}],
'lines-between-class-members': 'error',
'no-multiple-empty-lines': ['error', {max: 1}],
'import/newline-after-import': ['off', {count: 1}],
'prefer-template': 'off',
'curly': ['error', 'all'],
'no-plusplus': 'off',
'no-restricted-properties': 'off',
'prefer-destructuring': 'off',
'class-methods-use-this': 'off',
'no-param-reassign': 'off',
'max-len': 'off',
'no-return-await': 'off',
'array-bracket-spacing': 'off',
'radix': 'off',
'camelcase': 'off',
'no-lonely-if': 'off',
'no-mixed-operators': 'off',
'no-shadow': 'off',
'no-useless-concat': 'off',
'no-continue': 'off',
'no-else-return': 'off',
'no-unneeded-ternary': 'off',
'operator-assignment': 'off',
'no-underscore-dangle': 'off',
'consistent-return': 'off',
'no-await-in-loop': 'off',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
'arrow-spacing': ['warn', {before: true, after: true}],
'arrow-parens': ['error', 'always'],
'key-spacing': ['error', {beforeColon: false, afterColon: true}],
'comma-spacing': ['warn', {before: false, after: true}],
'import/no-extraneous-dependencies': ['error', {devDependencies: true}],
'import/prefer-default-export': 'off',
'jsdoc/require-jsdoc': 'off',
'@typescript-eslint/type-annotation-spacing': [
'error',
{
before: false,
after: true,
overrides: {
arrow: {
before: true,
},
},
},
],
'@typescript-eslint/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: true,
},
multilineDetection: 'brackets',
},
],
'@typescript-eslint/object-curly-spacing': ['error', 'never'],
},
};
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,21 @@
"@babel/core": "^7.24.4",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/preset-env": "^7.24.4",
"@bamdadsabbagh/eslint-config": "^2.0.26",
"@bamdadsabbagh/stylelint-config": "^1.3.57",
"@types/chrome": "^0.0.266",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"babel-loader": "^9.1.3",
"concurrently": "^8.2.2",
"copy-webpack-plugin": "^12.0.2",
"css-minimizer-webpack-plugin": "^6.0.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^48.2.3",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^12.1.0",
"html-minimizer-webpack-plugin": "^5.0.0",
"jest": "^29.7.0",
"jest-canvas-mock": "^2.5.2",
Expand Down
Loading

0 comments on commit 8f3d75d

Please sign in to comment.