Skip to content

Commit 3c14edd

Browse files
committed
Update cookiecutter templates
1 parent 772f0bd commit 3c14edd

File tree

127 files changed

+3631
-2340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+3631
-2340
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"project": "./tsconfig.json",
6+
"ecmaVersion": 2020, // Allows for the parsing of modern JS
7+
"ecmaFeatures": {
8+
"jsx": true // Allows for the parsing of JSX
9+
}
10+
},
11+
"ignorePatterns": [
12+
"package-lock.json",
13+
"package.json",
14+
"!.stylelintrc.json",
15+
"*.md",
16+
"*.css",
17+
"dist"
18+
],
19+
"extends": ["airbnb-typescript", "plugin:prettier/recommended"],
20+
"plugins": ["@typescript-eslint", "import", "react", "prettier"],
21+
"rules": {
22+
"@typescript-eslint/no-explicit-any": "off", // allow any because template often can't predict users' types
23+
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
24+
"react/no-danger": "off", // it's self explainatory that no-danger should be used sparingly
25+
"react/prop-types": "off", // as long as TS strict mode is off this is not required
26+
"react/function-component-definition": [
27+
2,
28+
{
29+
"namedComponents": "arrow-function",
30+
"unnamedComponents": "arrow-function"
31+
}
32+
],
33+
"react/jsx-props-no-spreading": "off",
34+
"react/react-in-jsx-scope": "off",
35+
"no-console": "error", // no console statements allowed,
36+
"no-plusplus": "off",
37+
"prettier/prettier": "off" // don't show prettier errors as it will be fixed when saved anyway
38+
},
39+
"settings": {
40+
"react": {
41+
"version": "detect"
42+
}
43+
},
44+
"env": {
45+
"node": true,
46+
"browser": true,
47+
"amd": true
48+
}
49+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cd strudel-taskflows
2+
npx lint-staged
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,jsx,ts,tsx,css,md,mdx}": ["eslint --cache --fix", "prettier --write"]
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"printWidth": 80,
5+
"semi": true,
6+
"trailingComma": "es5",
7+
"singleQuote": true,
8+
"endOfLine": "lf"
9+
}

strudel-cookiecutter/base/{@cookiecutter.name@}/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ npm start
2626

2727
Open [http://localhost:3000](http://localhost:3000) to view the app in the browser.
2828

29-
Begin modifying the templates in `src/app`.
29+
Begin modifying the templates in `src/pages`.
3030

3131
## Learn More
3232

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import { defineConfig } from "cypress";
1+
import { defineConfig } from 'cypress';
22

33
export default defineConfig({
44
e2e: {
55
baseUrl: 'http://localhost:5175/',
6-
specPattern: ['cypress/e2e/**/*.cy.{js,jsx,ts,tsx}', 'src/**/*.cy.{js,jsx,ts,tsx}']
6+
specPattern: [
7+
'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}',
8+
'src/**/*.cy.{js,jsx,ts,tsx}',
9+
],
710
},
811
});

strudel-cookiecutter/base/{@cookiecutter.name@}/cypress/e2e/home.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ describe('The Home Page', () => {
33
cy.visit('/');
44
cy.contains('Registered Pages');
55
});
6-
});
6+
});

strudel-cookiecutter/base/{@cookiecutter.name@}/cypress/support/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
3535
// }
3636
// }
37-
// }
37+
// }

strudel-cookiecutter/base/{@cookiecutter.name@}/cypress/support/e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// ***********************************************************
1515

1616
// Import commands.js using ES2015 syntax:
17-
import './commands'
17+
import './commands';
1818

1919
// Alternatively you can use CommonJS syntax:
20-
// require('./commands')
20+
// require('./commands')

strudel-cookiecutter/base/{@cookiecutter.name@}/package.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
"start": "vite",
99
"dev": "vite",
1010
"build": "tsc && vite build",
11-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
1211
"preview": "vite preview",
13-
"deploy": "gh-pages -d dist -e demo"
12+
"deploy": "gh-pages -d dist -e demo",
13+
"style:all": "tsc && npm run lint && npm run prettier",
14+
"lint": "eslint . '**/*.{js,jsx,ts,tsx}'",
15+
"lint:fix": "eslint . --fix '**/*.{js,jsx,ts,tsx}'",
16+
"prettier": "prettier . --check '**/*.{js,jsx,ts,tsx}'",
17+
"prettier:fix": "prettier . --write '**/*.{js,jsx,ts,tsx}'",
18+
"prepare": "cd ../ && husky ./strudel-taskflows/.husky"
1419
},
1520
"dependencies": {
1621
"@emotion/react": "^11.11.4",
@@ -41,11 +46,20 @@
4146
"@vitejs/plugin-react": "^4.2.1",
4247
"cypress": "^13.15.0",
4348
"eslint": "^8.57.0",
49+
"eslint-config-airbnb-typescript": "^18.0.0",
50+
"eslint-config-prettier": "^9.1.0",
51+
"eslint-plugin-import": "^2.31.0",
52+
"eslint-plugin-jsx-a11y": "^6.10.1",
53+
"eslint-plugin-prettier": "^5.2.1",
54+
"eslint-plugin-react": "^7.37.2",
4455
"eslint-plugin-react-hooks": "^4.6.0",
4556
"eslint-plugin-react-refresh": "^0.4.6",
4657
"gh-pages": "^6.1.1",
58+
"husky": "^9.1.6",
59+
"lint-staged": "^15.2.10",
60+
"prettier": "^3.3.3",
4761
"typescript": "^5.2.2",
48-
"vite": "^5.2.10"
62+
"vite": "^5.4.14"
4963
},
5064
"engines": {
5165
"node": "^18.18.0 || >=20.0.0"

0 commit comments

Comments
 (0)