Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Commit

Permalink
feat: add autoprefixer
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-W-James committed Nov 26, 2022
1 parent 8704838 commit 28574cd
Show file tree
Hide file tree
Showing 10 changed files with 9,792 additions and 4,562 deletions.
194 changes: 2 additions & 192 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,194 +1,4 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
ecmaVersion: "latest",
ecmaFeatures: {
impliedStrict: true,
jsx: true,
},
},
env: {
browser: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/jsx-runtime",
"plugin:react/recommended",
"plugin:import/recommended",
"airbnb-typescript",
"airbnb/hooks",
"plugin:sonarjs/recommended",
"plugin:jsx-a11y/recommended",
"plugin:prettier/recommended",
"plugin:storybook/recommended",
"./.eslintrc-auto-import.json",
],
plugins: [
"react",
"@typescript-eslint",
"sonarjs",
"jsx-a11y",
"prettier",
"vitest",
"prefer-arrow-functions",
],
// Ignore files in root
ignorePatterns: ["/*.*"],
settings: {
react: {
createClass: "createReactClass",
// Regex for Component Factory to use
pragma: "React",
// Pragma to use, default to "React"
fragment: "Fragment",
// Fragment to use (may be a property of <pragma>), default to "Fragment"
version: "detect",
// React version. "detect" automatically picks the version you have installed.
flowVersion: "0.53", // Flow version
},
propWrapperFunctions: [
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
"forbidExtraProps",
{
property: "freeze",
object: "Object",
},
{
property: "myFavoriteWrapper",
}, // for rules that check exact prop wrappers
{
property: "forbidExtraProps",
exact: true,
},
],
componentWrapperFunctions: [
// The name of any function used to wrap components, e.g. Mobx `observer` function. If this isn't set, components wrapped by these functions will be skipped.
"observer", // `property`
{
property: "styled",
}, // `object` is optional
{
property: "observer",
object: "Mobx",
},
{
property: "observer",
object: "<pragma>",
}, // sets `object` to whatever value `settings.react.pragma` is set to
],
formComponents: [
// Components used as alternatives to <form> for forms, eg. <Form endpoint={ url } />
"CustomForm",
{
name: "Form",
formAttribute: "endpoint",
},
],
linkComponents: [
// Components used as alternatives to <a> for linking, eg. <Link to={ url } />
"Hyperlink",
{
name: "Link",
linkAttribute: "to",
},
],
},
rules: {
"@typescript-eslint/no-unused-expressions": [
"error",
{
allowShortCircuit: true,
allowTernary: true,
},
],
"react/prefer-stateless-function": "error",
"import/no-extraneous-dependencies": [
"error",
// allow devDependencies to be imported into testing files, etc.
{ devDependencies: ["**/*.{test,spec,story,stories}.{ts,tsx}"] },
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
},
],
"require-await": "warn",
"prefer-arrow-functions/prefer-arrow-functions": [
"warn",
{
classPropertiesAllowed: true,
disallowPrototype: true,
returnStyle: "unchanged",
},
],
"arrow-body-style": "warn",
"prefer-arrow-callback": [
"warn",
{
allowNamedFunctions: true,
},
],
"react/self-closing-comp": "warn",
"react/jsx-sort-props": "warn",
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"@typescript-eslint/naming-convention": [
"warn",
{
selector: "default",
format: ["camelCase"],
},
{
selector: "variable",
format: ["PascalCase", "camelCase", "UPPER_CASE"],
},
{
selector: "parameter",
format: ["camelCase"],
leadingUnderscore: "allow",
},
{
selector: "memberLike",
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "require",
},
{
selector: "typeLike",
format: ["PascalCase"],
},
],
"max-len": [
"warn",
{
code: 80,
tabWidth: 2,
ignoreUrls: true,
ignoreRegExpLiterals: true,
},
],
curly: "warn",
"object-shorthand": "warn",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/quotes": "off",
"@typescript-eslint/comma-dangle": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-one-expression-per-line": "off",
"react/prop-types": "off",
},
overrides: [
{
// overrides for tests
files: ["*.test.{ts,tsx}"],
},
{
// override for storybook
files: ["*.{stories,story}.{ts,tsx}"],
},
],
extends: ["@tim-w-james", "./.eslintrc-auto-import.json"],
plugins: ["vitest"],
};
5 changes: 5 additions & 0 deletions .postcssrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {},
},
};
25 changes: 22 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,43 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Firefox",
"request": "launch",
"type": "firefox",
// ! Change to where Firefox or Firefox developer edition is installed
"firefoxExecutable": "/opt/firefox/firefox",
"reAttach": true,
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
// Launch Firefox with firefox-dev -start-debugger-server -no-remote
{
"name": "Attach to Firefox",
"port": 6000,
"request": "attach",
"type": "firefox",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
},
// Launch Chrome with: google-chrome --remote-debugging-port=9222
{
// launch chrome with: google-chrome --remote-debugging-port=9222
"name": "Attach to Chrome",
"port": 9222,
"request": "attach",
"type": "chrome",
"urlFilter": "https://localhost:3000/*",
"urlFilter": "http://localhost:3000/*",
"webRoot": "${workspaceFolder}"
},
{
"type": "pwa-node",
"type": "node",
"request": "launch",
"name": "Debug Tests",
"autoAttachChildProcesses": true,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 TimJ
Copyright (c) 2022 Timothy William James

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,32 @@
"@storybook/preview-web": "^6.5.12",
"@storybook/react": "^6.5.12",
"@storybook/testing-library": "^0.0.13",
"@tim-w-james/eslint-config": "1.0.3",
"@types/node": "^18.8.0",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@types/react-router-dom": "^5.3.3",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"@vitejs/plugin-react": "^2.1.0",
"@vitest/ui": "^0.23.4",
"autoprefixer": "^10.4.13",
"babel-loader": "^8.2.5",
"c8": "^7.12.0",
"debug": "^4.3.4",
"eslint": "^8.24.0",
"eslint": "^8.28.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-prefer-arrow-functions": "^3.1.4",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-sonarjs": "^0.15.0",
"eslint-plugin-storybook": "^0.6.4",
"eslint-plugin-sonarjs": "^0.16.0",
"eslint-plugin-storybook": "^0.6.7",
"eslint-plugin-vitest": "^0.0.8",
"happy-dom": "^6.0.4",
"http-server": "^14.1.1",
Expand All @@ -127,7 +129,7 @@
"stylelint-css-modules-no-global-scoped-selector": "^1.0.2",
"stylelint-order": "^5.0.0",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
"typescript": "^4.9.3",
"unplugin-auto-import": "^0.11.2",
"vite": "^3.1.4",
"vite-plugin-eslint": "^1.8.1",
Expand All @@ -147,9 +149,7 @@
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
"defaults"
],
"development": [
"last 1 chrome version",
Expand Down
Loading

0 comments on commit 28574cd

Please sign in to comment.