Skip to content

Commit

Permalink
chore: update ESLint configuration to use eslint.config.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamviktora committed Oct 8, 2024
1 parent b6ffa0c commit 9741fc3
Show file tree
Hide file tree
Showing 7 changed files with 256 additions and 194 deletions.
35 changes: 0 additions & 35 deletions .eslintignore

This file was deleted.

34 changes: 0 additions & 34 deletions .eslintrc-md.json

This file was deleted.

98 changes: 0 additions & 98 deletions .eslintrc.json

This file was deleted.

51 changes: 28 additions & 23 deletions .recipes/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,51 @@
"start": "yarn build && concurrently --kill-others \"yarn workspace {{ tmplr.npm_scope }}/{{ tmplr.extension_name | kebab-case }} docs:develop\"",
"serve:docs": "yarn workspace {{ tmplr.npm_scope }}/{{ tmplr.extension_name | kebab-case }} docs:serve",
"clean": "yarn workspace {{ tmplr.npm_scope }}/{{ tmplr.extension_name | kebab-case }} clean",
"lint:js": "node --max-old-space-size=4096 node_modules/.bin/eslint packages --ext js,jsx,ts,tsx --cache",
"lint:md": "yarn eslint packages --ext md --no-eslintrc --config .eslintrc-md.json --cache",
"lint:js": "node --max-old-space-size=4096 node_modules/.bin/eslint packages --cache",
"lint:md": "eslint \"**/*.md\" --config eslint.config-md.mjs --cache --cache-strategy content --no-warn-ignored",
"lint": "yarn lint:js && yarn lint:md",
"test": "TZ=EST jest packages",
"test:a11y": "yarn workspace {{ tmplr.npm_scope }}/{{ tmplr.extension_name | kebab-case }} test:a11y",
"serve:a11y": "yarn workspace {{ tmplr.npm_scope }}/{{ tmplr.extension_name | kebab-case }} serve:a11y"
},
"devDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "^5.5.4",
"@babel/core": "^7.24.7",
"@babel/plugin-transform-modules-commonjs": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-flow": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@eslint/compat": "^1.2.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.13",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"babel-jest": "^29.7.0",
"concurrently": "^9.0.1",
"eslint": "^9.12.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-markdown": "^5.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-n": "^17.10.2",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-config-prettier": "9.1.0",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"prettier": "3.3.3",
"globals": "^15.10.0",
"jest": "^29.7.0",
"babel-jest": "^29.7.0",
"@babel/core": "^7.24.7",
"@babel/plugin-transform-modules-commonjs": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-flow": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^14.5.2",
"@testing-library/jest-dom": "^6.4.8",
"@testing-library/dom": "^10.4.0",
"jest-environment-jsdom": "^29.7.0",
"serve": "^14.2.3"
"prettier": "3.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"serve": "^14.2.3",
"typescript": "^5.5.4",
"typescript-eslint": "^8.8.1"
}
}
33 changes: 33 additions & 0 deletions eslint.config-md.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import markdown from 'eslint-plugin-markdown';
import react from 'eslint-plugin-react';
import tseslint from 'typescript-eslint';

export default [
{
ignores: ['.history/*']
},
...markdown.configs.recommended,
{
plugins: {
react
},
languageOptions: {
parser: tseslint.parser
},
settings: {
react: {
version: 'detect'
}
},
rules: {
'eol-last': 'error',
'spaced-comment': 'error',
'no-unused-vars': 'off',
'no-this-before-super': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-unknown-property': 'error',
'react/jsx-no-undef': 'error'
}
}
];
Loading

0 comments on commit 9741fc3

Please sign in to comment.