Skip to content

Commit

Permalink
setup eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
saharmehrpour committed Jun 27, 2024
1 parent bd7ba0a commit 272fbaf
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build/
node_modules/
config-overrides.js
src/configureMonaco.js
src/monaco-worker-loader-proxy.dev.js
src/monaco-worker-loader-proxy.js
src/registerServiceWorker.js
src/core/generated-parser/
src/web-socket-js/
71 changes: 71 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"env": {
"browser": true,
"node": true,
"jasmine": true,
"es6": true
},
"extends": [
"eslint:recommended",
"google",
"plugin:import/errors",
"plugin:jsx-a11y/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended"
],
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"babelOptions": {
"presets": ["@babel/preset-react"]
}
},
"plugins": [
"react",
"import",
"jsx-a11y"
],
"rules": {
"camelcase": "off",
"guard-for-in": "warn",
"import/default": "off",
"import/export": "off",
"import/namespace": "off",
"indent": ["error", 4, {"SwitchCase": 1}],
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/no-static-element-interactions": "off",
"max-len": "off",
"new-cap": "off",
"no-case-declarations": "off",
"no-constant-condition": "off",
"no-control-regex": "off",
"no-invalid-this": "off",
"no-prototype-builtins": "off",
"no-unused-vars": ["error", {"varsIgnorePattern": "React", "argsIgnorePattern": "^_"}],
"object-curly-spacing": ["error", "never"],
"prefer-promise-reject-errors": "off",
"quotes": ["error", "double"],
"react/prop-types": "off",
"react/no-unescaped-entities": "off",
"require-jsdoc": "off",
"valid-jsdoc": "off"
},
"overrides": [
{
"files": ["*Constants.js", "*Constant.js", "*Config.js"],
"rules": {"camelcase": "off"}
},
{
"files": ["*.test.js", "src/ui/RulePad/rulePad.js"],
"rules": {"max-len": "off"}
}
],
"settings": {
"react": {
"version": "detect"
}
}
}
26 changes: 26 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: ESLint

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'

jobs:
eslint:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install ESLint
run: npm install [email protected] @microsoft/[email protected]

- name: Run ESLint
run: npx eslint . --ext .js --config .eslintrc.json
12 changes: 12 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/env",
{
"targets": {
"node": "12"
}
}
]
]
}
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@
"wink-pos-tagger": "1.5.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.24.7",
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
"@eslint/js": "9.5.0",
"eslint": "^7.32.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.9.0",
"eslint-plugin-react": "7.34.3",
"eslint-plugin-react-hooks": "4.6.2",
"gh-pages": "3.1.0",
"jasmine": "^5.1.0",
"globals": "15.6.0",
"jasmine": "5.1.0",
"react-app-rewired": "2.1.8",
"react-scripts": "4.0.3"
},
Expand Down

0 comments on commit 272fbaf

Please sign in to comment.