Skip to content

Commit

Permalink
[add] eslint, lint-staged
Browse files Browse the repository at this point in the history
[update] dependencies
  • Loading branch information
Soecka committed Sep 9, 2024
1 parent dfc2a85 commit 8fbea75
Show file tree
Hide file tree
Showing 3 changed files with 2,898 additions and 1,726 deletions.
72 changes: 72 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import globals from 'globals';
import js from '@eslint/js';
import json from '@eslint/json';
import markdown from '@eslint/markdown';
import tseslint from 'typescript-eslint';

import react from 'eslint-plugin-react';
import eslintConfigPrettier from 'eslint-config-prettier';
import simpleImportSort from 'eslint-plugin-simple-import-sort';

export default [
// import sort
{
plugins: {
'simple-import-sort': simpleImportSort
},
rules: {
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error'
}
},
// typescript
{
files: ['**/*.{ts,tsx}'],
plugins: {
'@typescript-eslint': tseslint.plugin
}
},
// js
{
name: 'eslint/js',
files: ['**/*.{js,ts,jsx,tsx}'],
languageOptions: { globals: globals.browser },
plugins: { js },
rules: {
'consistent-return': 'error'
}
},
// react
{
name: 'react-jsx',
files: ['**/*.{js,ts,jsx,tsx}'],
plugins: { react },
rules: {
'react/jsx-no-target-blank': 'warn',
'react/jsx-sort-props': [
'error',
{
reservedFirst: true,
shorthandLast: true,
callbacksLast: true,
noSortAlphabetically: true
}
]
}
},
// JSON files
{
name: 'eslint/json',
files: ['**/*.json', '.c8rc'],
ignores: ['**/package-lock.json'],
language: 'json/json',
plugins: { json }
},
// markdown
{
files: ['**/*.md'],
language: 'markdown/gfm',
plugins: { markdown }
},
eslintConfigPrettier
];
54 changes: 33 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,61 @@
"author": "[email protected]",
"dependencies": {
"@editorjs/code": "^2.9.0",
"@editorjs/editorjs": "^2.29.1",
"@editorjs/header": "^2.8.1",
"@editorjs/image": "^2.9.0",
"@editorjs/editorjs": "^2.30.5",
"@editorjs/header": "^2.8.7",
"@editorjs/image": "^2.9.3",
"@editorjs/link": "^2.6.2",
"@editorjs/list": "^1.9.0",
"@editorjs/paragraph": "^2.11.5",
"@editorjs/quote": "^2.6.0",
"@editorjs/list": "^1.10.0",
"@editorjs/paragraph": "^2.11.6",
"@editorjs/quote": "^2.7.2",
"browser-fs-access": "^0.35.0",
"browser-unhandled-rejection": "^1.0.2",
"echarts-jsx": "^1.2.0",
"echarts-jsx": "^1.2.1",
"editorjs-html": "^3.4.3",
"idea-react": "^2.0.0-rc.2",
"koajax": "^1.1.2",
"koajax": "^3.0.2",
"lodash": "^4.17.21",
"mobx": "^6.12.4",
"mobx": "^6.13.1",
"mobx-github": "^0.3.2",
"mobx-i18n": "^0.5.0",
"mobx-react": "^9.1.1",
"mobx-restful": "^1.0.0",
"mobx-restful-table": "^2.0.0-rc.1",
"preact": "^10.22.0",
"react-bootstrap": "^2.10.3",
"preact": "^10.23.2",
"react-bootstrap": "^2.10.4",
"react-bootstrap-editor": "^2.0.4",
"react-editor-js": "^2.1.0",
"react-router-class-tools": "^0.1.3",
"react-router-dom": "^6.24.0",
"react-router-dom": "^6.26.1",
"web-utility": "^4.4.0"
},
"devDependencies": {
"@babel/runtime": "^7.24.7",
"@babel/runtime": "^7.25.6",
"@eslint/js": "^9.9.1",
"@eslint/json": "^0.4.0",
"@eslint/markdown": "^6.0.0",
"@parcel/config-default": "~2.12.0",
"@parcel/packager-raw-url": "~2.12.0",
"@parcel/transformer-less": "~2.12.0",
"@parcel/transformer-typescript-tsc": "~2.12.0",
"@parcel/transformer-webmanifest": "~2.12.0",
"@types/lodash": "^4.17.5",
"@types/node": "^18.19.39",
"@types/lodash": "^4.17.7",
"@types/node": "^20.16.2",
"buffer": "^6.0.3",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"eslint": "9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^15.9.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.9",
"parcel": "~2.12.0",
"parcel-transformer-mdx": "^0.3.3",
"prettier": "^3.3.2",
"parcel-transformer-mdx": "^0.4.2",
"prettier": "^3.3.3",
"prismjs": "^1.29.0",
"process": "^0.11.10",
"typescript": "~5.5.2",
"typescript": "~5.5.4",
"typescript-eslint": "^8.4.0",
"workbox-cli": "^7.1.0"
},
"alias": {
Expand All @@ -66,7 +75,10 @@
"tabWidth": 4
},
"lint-staged": {
"*.{html,md,less,json,yml,js,ts,tsx}": "prettier --write"
"*.{html,md,less,json,yml,js,ts,tsx}": [
"eslint --fix",
"prettier --write"
]
},
"browserslist": "> 0.5%, last 2 versions, not dead, IE 11",
"scripts": {
Expand Down
Loading

0 comments on commit 8fbea75

Please sign in to comment.