UNPKG

@smartrep/web-widget

Version:

Client side library to load the web widget

67 lines (63 loc) 1.75 kB
const globals = require('globals'); const jsPlugin = require('@eslint/js'); const reactHooks = require('eslint-plugin-react-hooks'); const reactPlugin = require('eslint-plugin-react'); const prettierPlugin = require('eslint-plugin-prettier'); const importPlugin = require('eslint-plugin-import'); const babelParser = require('@babel/eslint-parser'); const jsxA11y = require('eslint-plugin-jsx-a11y'); const languageOptions = { ...reactPlugin.configs.flat.recommended.languageOptions, ecmaVersion: 2020, globals: { ...globals.browser, ...globals.node, ...globals.jest }, parser: babelParser, parserOptions: { requireConfigFile: false, babelOptions: { configFile: './.babelrc' }, ecmaFeatures: { jsx: true } } }; const plugins = { prettier: prettierPlugin, react: reactPlugin, 'react-hooks': reactHooks, import: importPlugin, 'jsx-a11y': jsxA11y }; module.exports = [ { files: ['**/*.{js,jsx}'] }, { ignores: ['lib'] }, { languageOptions }, { plugins }, jsPlugin.configs.recommended, reactPlugin.configs.flat.recommended, reactPlugin.configs.flat['jsx-runtime'], { rules: { ...reactHooks.configs.recommended.rules, ...jsxA11y.flatConfigs.strict.rules, 'prettier/prettier': 'error', 'react/prop-types': 'off', 'react/jsx-uses-react': 'off', 'react/react-in-jsx-scope': 'off', 'react/no-danger': 'error', 'react/forbid-prop-types': 'warn', 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'error', 'no-unused-vars': 'off', 'consistent-return': 'off', 'import/no-mutable-exports': 'error' } }, { settings: { react: { version: 'detect' } } } ];