1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Improve lint-staged config (#28704)

This commit is contained in:
Renaud Chaput 2024-01-12 10:09:57 +01:00 committed by GitHub
parent 575ab085be
commit 923fc83190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 7 deletions

View file

@ -73,3 +73,5 @@ app/javascript/styles/mastodon/reset.scss
# Ignore the generated AUTHORS.md # Ignore the generated AUTHORS.md
AUTHORS.md AUTHORS.md
!lint-staged.config.js

11
lint-staged.config.js Normal file
View file

@ -0,0 +1,11 @@
const config = {
'*': 'prettier --ignore-unknown --write',
'Capfile|Gemfile|*.{rb,ruby,ru,rake}':
'bundle exec rubocop --force-exclusion -a',
'*.{js,jsx,ts,tsx}': 'eslint --fix',
'*.{css,scss}': 'stylelint --fix',
'*.haml': 'bundle exec haml-lint -a',
'**/*.ts?(x)': () => 'tsc -p tsconfig.json --noEmit',
};
module.exports = config;

View file

@ -218,11 +218,5 @@
"react-router-dom": { "react-router-dom": {
"optional": true "optional": true
} }
},
"lint-staged": {
"*": "prettier --ignore-unknown --write",
"Capfile|Gemfile|*.{rb,ruby,ru,rake}": "bundle exec rubocop --force-exclusion -a",
"*.{js,jsx,ts,tsx}": "eslint --fix",
"*.{css,scss}": "stylelint --fix"
} }
} }

View file

@ -13,7 +13,7 @@
}, },
"scripts": { "scripts": {
"start": "node ./index.js", "start": "node ./index.js",
"check:types": "tsc --noEmit" "typecheck": "tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"cors": "^2.8.5", "cors": "^2.8.5",

View file

@ -5,6 +5,7 @@
"module": "CommonJS", "module": "CommonJS",
"moduleResolution": "node", "moduleResolution": "node",
"noUnusedParameters": false, "noUnusedParameters": false,
"tsBuildInfoFile": "../tmp/cache/streaming/tsconfig.tsbuildinfo",
"paths": {} "paths": {}
}, },
"include": ["./*.js", "./.eslintrc.js"] "include": ["./*.js", "./.eslintrc.js"]

View file

@ -10,6 +10,8 @@
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true, "skipLibCheck": true,
"baseUrl": "./", "baseUrl": "./",
"incremental": true,
"tsBuildInfoFile": "tmp/cache/tsconfig.tsbuildinfo",
"paths": { "paths": {
"mastodon": ["app/javascript/mastodon"], "mastodon": ["app/javascript/mastodon"],
"mastodon/*": ["app/javascript/mastodon/*"] "mastodon/*": ["app/javascript/mastodon/*"]