{"_id":"@acopier/eslint-plugin-roblox-ts","name":"@acopier/eslint-plugin-roblox-ts","dist-tags":{"latest":"0.0.36"},"versions":{"0.0.36":{"name":"@acopier/eslint-plugin-roblox-ts","version":"0.0.36","main":"out/index.js","engines":{"node":">=0.10.0"},"scripts":{"build":"tsc","build-watch":"tsc -w","prepublishOnly":"npm run build","eslint":"eslint \"src/**/*.ts\" --max-warnings 0"},"dependencies":{"@types/node":"^20.8.0","@typescript-eslint/experimental-utils":"^5.62.0","typescript":"^5.2.2"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^6.7.3","@typescript-eslint/parser":"^6.7.3","eslint":"^8.50.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.0","prettier":"^3.0.3"},"_id":"@acopier/eslint-plugin-roblox-ts@0.0.36","gitHead":"69625acb0144ccaca644a65eaa7fba31c3e703ba","description":"![lint rules demo](https://user-images.githubusercontent.com/15217173/64753460-ed490e80-d4e8-11e9-9af9-06fb1a0aceae.gif)","_nodeVersion":"22.1.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-aI+7AvEjGldSgYs59TJEo8cWikE/h6hXbS7LbxGo6/OkXk4SQd2s5Q2vhYshPK0n2UJFtvYE0d0UvzUKdddRnw==","shasum":"fe41b8cf0347cfbc48c740bdf6e0c1eb64d1f3ab","tarball":"https://registry.npmjs.org/@acopier/eslint-plugin-roblox-ts/-/eslint-plugin-roblox-ts-0.0.36.tgz","fileCount":27,"unpackedSize":56736,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCy8dIgr3YC0rcnws1vnBE2CV3AnMWTidfclxo+/2er3gIgFEws6g6F6nOaNW224oyl3mJU5jbYkeLTThPq3xFVCFc="}]},"_npmUser":{"name":"acopier","email":"filip.hrouda@outlook.cz"},"directories":{},"maintainers":[{"name":"acopier","email":"filip.hrouda@outlook.cz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-roblox-ts_0.0.36_1715511201234_0.9261871908829948"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-12T10:53:21.131Z","0.0.36":"2024-05-12T10:53:21.422Z","modified":"2024-05-12T10:53:21.694Z"},"maintainers":[{"name":"acopier","email":"filip.hrouda@outlook.cz"}],"description":"![lint rules demo](https://user-images.githubusercontent.com/15217173/64753460-ed490e80-d4e8-11e9-9af9-06fb1a0aceae.gif)","readme":"# eslint-plugin-roblox-ts\r\n\r\n![lint rules demo](https://user-images.githubusercontent.com/15217173/64753460-ed490e80-d4e8-11e9-9af9-06fb1a0aceae.gif)\r\n\r\n\r\nWhat follows is an incomplete guide on how to get started using typescript-eslint with eslint-plugin-roblox-ts and prettier. We eventually plan to make a better guide and automate a number of these steps through `rbxtsc` command line options. But, for now, here is how to use these lint rules with VSCode.\r\n\r\n## Step 1: Install the ESLint plugin for VSCode\r\nInstall the following:\r\n\r\n<a href=\"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint\"><img src=\"https://camo.githubusercontent.com/e16321b339b250b46af5bcb05ed36892e6770342/68747470733a2f2f64626165756d65722e67616c6c65727963646e2e76736173736574732e696f2f657874656e73696f6e732f64626165756d65722f7673636f64652d65736c696e742f312e392e312f313536363239383133363236392f4d6963726f736f66742e56697375616c53747564696f2e53657276696365732e49636f6e732e44656661756c74\" data-canonical-src=\"https://dbaeumer.gallerycdn.vsassets.io/extensions/dbaeumer/vscode-eslint/1.9.1/1566298136269/Microsoft.VisualStudio.Services.Icons.Default\" width=\"100\" height=\"100\"></a>\r\n\r\n<!-- \r\n<a href=\"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode\"><img src=\"https://camo.githubusercontent.com/439873e3a6c9faa27a6f9d69ab8a9cc91bf7dc84/68747470733a2f2f657362656e702e67616c6c65727963646e2e76736173736574732e696f2f657874656e73696f6e732f657362656e702f70726574746965722d7673636f64652f312e31302e302f313536363537333135313038332f4d6963726f736f66742e56697375616c53747564696f2e53657276696365732e49636f6e732e44656661756c74\" data-canonical-src=\"https://esbenp.gallerycdn.vsassets.io/extensions/esbenp/prettier-vscode/1.10.0/1566573151083/Microsoft.VisualStudio.Services.Icons.Default\" width=\"100\" height=\"100\"></a>\r\n-->\r\n\r\n## Step 2: Change your VSCode settings\r\nMake sure the following settings are in your settings file (`Ctrl + ,` to open the settings UI, then press the `Open Settings (JSON)` button in the top right).\r\n\r\nThese are according to my preferences, so feel free to change this according to your own desires:\r\n```json\r\n\t\"files.trimTrailingWhitespace\": true,\r\n\t\"files.insertFinalNewline\": true,\r\n\t\"files.trimFinalNewlines\": true,\r\n\t\"[typescript]\": {\r\n\t\t\"editor.defaultFormatter\": \"dbaeumer.vscode-eslint\",\r\n\t\t\"editor.formatOnSave\": true,\r\n\t\t\"editor.formatOnPaste\": true,\r\n\t\t\"editor.formatOnType\": true,\r\n\t},\r\n\t\"[typescriptreact]\": {\r\n\t\t\"editor.defaultFormatter\": \"dbaeumer.vscode-eslint\",\r\n\t\t\"editor.formatOnSave\": true,\r\n\t\t\"editor.formatOnPaste\": true,\r\n\t\t\"editor.formatOnType\": true,\r\n\t},\r\n\t\"eslint.packageManager\": \"npm\",\r\n\t\"eslint.run\": \"onType\",\r\n\t\"eslint.format.enable\": true,\r\n```\r\n\r\n## Step 3: Setup the eslint config file\r\nMake a file named `.eslintrc` and place this in the contents.\r\n\r\n```json\r\n{\r\n    \"parser\": \"@typescript-eslint/parser\",\r\n    \"parserOptions\": {\r\n        \"jsx\": true,\r\n        \"useJSXTextNode\": true,\r\n        \"ecmaVersion\": 2018,\r\n        \"sourceType\": \"module\",\r\n        \"project\": \"./tsconfig.json\"\r\n    },\r\n    \"plugins\": [\r\n        \"roblox-ts\",\r\n        \"@typescript-eslint\",\r\n        \"@typescript-eslint/eslint-plugin\",\r\n        \"prettier\"\r\n    ],\r\n    \"extends\": [\r\n        \"eslint:recommended\",\r\n        \"plugin:@typescript-eslint/recommended\",\r\n        \"plugin:prettier/recommended\",\r\n        \"plugin:roblox-ts/recommended\"\r\n    ],\r\n    \"rules\": {\r\n        \"prettier/prettier\": \"warn\",\r\n        \"@typescript-eslint/array-type\": [\r\n            \"warn\",\r\n            {\r\n                \"default\": \"generic\",\r\n                \"readonly\": \"generic\"\r\n            }\r\n        ],\r\n        \"@typescript-eslint/no-unused-vars\": \"off\",\r\n        \"@typescript-eslint/explicit-function-return-type\": \"off\",\r\n        \"@typescript-eslint/no-namespace\": \"off\",\r\n        \"@typescript-eslint/no-non-null-assertion\": \"off\",\r\n        \"@typescript-eslint/no-empty-function\": \"warn\",\r\n\t\"prefer-const\": [\r\n\t\t\"warn\",\r\n\t\t{\r\n\t\t\t\"destructuring\": \"all\"\r\n\t\t}\r\n\t],\r\n        \"no-undef-init\": \"error\"\r\n    }\r\n}\r\n```\r\nIf you have a pre-existing `.prettierrc` file, you can keep it, and eslint will pick it up and use that.\r\nIf not, you can create it with this recommended config:\r\n```json\r\n{\r\n\t\"semi\": true,\r\n\t\"trailingComma\": \"all\",\r\n\t\"singleQuote\": false,\r\n\t\"printWidth\": 120,\r\n\t\"tabWidth\": 4,\r\n\t\"useTabs\": true\r\n}\r\n```\r\n\r\n## Step 4: Install the necessary packages\r\n\r\nRun the following command:\r\n\r\n`npm i -D eslint prettier @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-config-prettier eslint-plugin-prettier eslint-plugin-roblox-ts`\r\n\r\n<!-- For roact development: npm i -D eslint-config-react -->\r\n\r\n## Step 5: Reload window\r\nType `Ctrl+Shift+P` and select `Developer: Reload Window`. \r\n","readmeFilename":"README.md"}