Skip to content

Commit

Permalink
chore: fix "lint" script & add "lint-fix" script (#212)
Browse files Browse the repository at this point in the history
Fixes:
- Windows compatibility
- cover more files (e.g. files in cypress dir & root dir)
  • Loading branch information
zenflow authored and limonte committed Nov 7, 2022
1 parent 6da07a9 commit 702f431
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
15 changes: 9 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"presets": [
["@babel/preset-env", {
"targets": {
"chrome": "88",
"firefox": "86",
"safari": "12"
[
"@babel/preset-env",
{
"targets": {
"chrome": "88",
"firefox": "86",
"safari": "12"
}
}
}],
],
["@babel/preset-react"]
],
"env": {
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package-lock.json
node_modules/
coverage/
.cache/
Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
coverage/
.cache/
dist/

CHANGELOG.md
2 changes: 1 addition & 1 deletion cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"start": "vite",
"cypress:open": "cypress open",
"check-dts": "tsc src/sweetalert2-react-content.d.ts --lib dom,es6",
"lint": "eslint src/**/*.{js,d.ts} test && prettier --check 'src/*.{js,d.ts}'",
"lint": "eslint . --ext .js,.jsx,.d.ts && prettier . --check",
"lint-fix": "eslint . --ext .js,.jsx,.d.ts --fix && prettier . --write",
"test": "cypress run --headless",
"build": "rollup --config",
"prepublishOnly": "npm run build"
Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()]
plugins: [react()],
})

0 comments on commit 702f431

Please sign in to comment.