{"id":19962992,"url":"https://github.com/taptima/front-linters-setup","last_synced_at":"2025-05-03T22:31:30.512Z","repository":{"id":43967170,"uuid":"251459492","full_name":"taptima/front-linters-setup","owner":"taptima","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-05T10:42:47.000Z","size":719,"stargazers_count":11,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-06T21:37:13.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taptima.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-31T00:21:54.000Z","updated_at":"2022-06-01T19:58:02.000Z","dependencies_parsed_at":"2023-02-04T01:45:32.559Z","dependency_job_id":null,"html_url":"https://github.com/taptima/front-linters-setup","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taptima%2Ffront-linters-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taptima%2Ffront-linters-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taptima%2Ffront-linters-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taptima%2Ffront-linters-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taptima","download_url":"https://codeload.github.com/taptima/front-linters-setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224374661,"owners_count":17300691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T02:14:13.782Z","updated_at":"2024-11-13T02:14:14.165Z","avatar_url":"https://github.com/taptima.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Front end linters setup\n* NPM update: \n  Caution! You should manually update package in npm after making changes in repo.\n\n* Installation: \n```\nyarn add husky lint-staged @taptima/front-linters-setup --dev\n```\n\n* Add following scripts to your **package.json**:\n```json\n\"scripts\": {\n  \"format\": \"prettier \\\"**/*.{js,jsx,json,css,scss}\\\" --write --config node_modules/front-linters-setup/configs/prettier/config.json --ignore-path node_modules/front-linters-setup/configs/.ignore\",\n  \"lint-styles\": \"stylelint \\\"**/*.{css,scss}\\\" --fix --config node_modules/front-linters-setup/configs/stylelint/formatConfig.json --ignore-path node_modules/front-linters-setup/configs/.ignore\",\n  \"lint-js\": \"eslint \\\"**/*.{js,jsx}\\\" --fix --ignore-path node_modules/front-linters-setup/configs/.ignore\"\n}\n```\n\n* Also add these lines to your **package.json** to enable pre-commit hooks\n```json\n\"husky\": {\n  \"hooks\": {\n    \"pre-commit\": \"lint-staged\"\n  }\n},\n\"lint-staged\": {\n\"*.{js,jsx}\": [\n  \"yarn run lint-js\",\n  \"yarn run format\"\n],\n\"*.{css,scss}\": [\n  \"yarn run lint-styles\",\n  \"yarn run format\"\n],\n\".json\": \"yarn run format\"\n}\n```\n\n* Provide stylelint configuration for your editor:\n```json\n\"stylelint\": {\n  \"extends\": \"./node_modules/front-linters-setup/configs/stylelint/baseConfig.json\"\n}\n``` \n\n* Provide eslint configuration (use `reactConfig.json` for React.js based projects):\n```json\n\"eslintConfig\": {\n  \"extends\": \"./node_modules/front-linters-setup/configs/eslint/baseConfig.json\"\n}\n``` \n\nNow you have configured linting \u0026 formatting of staged .css, .scss, .js, .jsx \u0026 .json files on pre-commit hook.\n\nYou can also format \u0026 lint all project .css, .scss, .js, .jsx \u0026 .json files using commands `yarn format`, \n`yarn lint-styles` \u0026 `yarn lint-js`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaptima%2Ffront-linters-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaptima%2Ffront-linters-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaptima%2Ffront-linters-setup/lists"}