From 6561755cb34960e2127a467a88a0b6648b99d657 Mon Sep 17 00:00:00 2001 From: Llewellyn D'souza Date: Fri, 4 Feb 2022 15:06:09 +0530 Subject: [PATCH] Linted: .eslintrc file --- .eslintrc.js | 76 ++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b9b076e..f1df110 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,60 +3,60 @@ module.exports = { env: { browser: true, commonjs: true, - es6: true, + es6: true }, - extends: ["eslint:recommended", "plugin:react/recommended"], - parser: "babel-eslint", + extends: ['eslint:recommended', 'plugin:react/recommended'], + parser: 'babel-eslint', parserOptions: { ecmaFeatures: { jsx: true, modules: true, - experimentalObjectRestSpread: true, + experimentalObjectRestSpread: true }, ecmaVersion: 2020, - sourceType: "module", + sourceType: 'module' }, - plugins: ["react"], + plugins: ['react'], rules: { // general - indent: ["error", 2, { SwitchCase: 1, ignoredNodes: ["TemplateLiteral"] }], - "linebreak-style": ["error", "unix"], - quotes: ["error", "single"], - semi: ["error", "always"], - "comma-dangle": [ - "error", + indent: ['error', 2, { SwitchCase: 1, ignoredNodes: ['TemplateLiteral'] }], + 'linebreak-style': ['error', 'unix'], + quotes: ['error', 'single'], + semi: ['error', 'always'], + 'comma-dangle': [ + 'error', { - arrays: "never", - objects: "never", - imports: "never", - exports: "never", - functions: "ignore", - }, + arrays: 'never', + objects: 'never', + imports: 'never', + exports: 'never', + functions: 'ignore' + } ], - "object-curly-spacing": ["error", "always"], - "eol-last": ["error", "always"], - "no-console": process.env.NODE_ENV === "production" ? "error" : "warn", - complexity: ["error", { max: 20 }], - eqeqeq: ["error", "always"], + 'object-curly-spacing': ['error', 'always'], + 'eol-last': ['error', 'always'], + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn', + complexity: ['error', { max: 20 }], + eqeqeq: ['error', 'always'], // react - "react/no-unescaped-entities": ["error", { forbid: [">", '"', "}"] }], - "react/prop-types": [2, { ignore: ["action", "dispatch", "nav", "navigation"] }], - "react/jsx-boolean-value": 2, - "react/jsx-no-undef": 2, - "react/react-in-jsx-scope": "off", + 'react/no-unescaped-entities': ['error', { forbid: ['>', '"', '}'] }], + 'react/prop-types': [2, { ignore: ['action', 'dispatch', 'nav', 'navigation'] }], + 'react/jsx-boolean-value': 2, + 'react/jsx-no-undef': 2, + 'react/react-in-jsx-scope': 'off', // allow jsx syntax in js files (for next.js project) - "react/jsx-filename-extension": [1, { extensions: [".js", ".jsx"] }], //should add ".ts" if typescript project - "react/jsx-sort-props": [ + 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], //should add ".ts" if typescript project + 'react/jsx-sort-props': [ 2, { callbacksLast: true, shorthandFirst: true, ignoreCase: true, - noSortAlphabetically: true, - }, + noSortAlphabetically: true + } ], - "react/jsx-pascal-case": 2, - "react/display-name": [0, { ignoreTranspilerName: false }], + 'react/jsx-pascal-case': 2, + 'react/display-name': [0, { ignoreTranspilerName: false }] }, // Map from global var to bool specifying if it can be redefined globals: { @@ -91,11 +91,11 @@ module.exports = { setInterval: false, setTimeout: false, window: false, - XMLHttpRequest: false, + XMLHttpRequest: false }, settings: { react: { - version: require("./package.json").dependencies.react, - }, - }, + version: require('./package.json').dependencies.react + } + } };