Skip to content

Commit

Permalink
chore: migrate to new eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw committed Jun 7, 2024
1 parent d6554b9 commit 8bacdc5
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 49 deletions.
43 changes: 43 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import globals from "globals";
import google from "eslint-config-google";

export default {
...google,
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
...globals.commonjs,
...globals.es2021,
},
},
rules: {
"arrow-parens": "off",
camelcase: "off",
indent: [
"error",
2,
{
SwitchCase: 1,
},
],
"max-len": [
"error",
{
code: 160,
ignoreComments: true,
ignoreUrls: true,
ignoreStrings: true,
},
],
"spaced-comment": [
"warn",
"always",
{
line: {
markers: ["/"],
},
},
],
},
};
23 changes: 18 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 4 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "tree-sitter-php",
"version": "0.22.5",
"type": "module",
"description": "PHP grammar for tree-sitter",
"repository": "github:tree-sitter/tree-sitter-php",
"license": "MIT",
Expand Down Expand Up @@ -51,6 +52,7 @@
"common/**"
],
"dependencies": {
"globals": "^15.4.0",
"node-addon-api": "^8.0.0",
"node-gyp-build": "^4.8.1"
},
Expand All @@ -63,7 +65,7 @@
}
},
"devDependencies": {
"eslint": ">=8.57.0",
"eslint": "^9.4.0",
"eslint-config-google": "^0.14.0",
"prebuildify": "^6.0.1",
"tree-sitter-cli": "^0.22.6"
Expand Down Expand Up @@ -95,47 +97,5 @@
"path": "php_only",
"external-files": "common/scanner.h"
}
],
"eslintConfig": {
"env": {
"commonjs": true,
"es2021": true
},
"extends": "google",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"arrow-parens": "off",
"camel-case": "off",
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"max-len": [
"error",
{
"code": 160,
"ignoreComments": true,
"ignoreUrls": true,
"ignoreStrings": true
}
],
"spaced-comment": [
"warn",
"always",
{
"line": {
"markers": [
"/"
]
}
}
]
}
}
]
}

0 comments on commit 8bacdc5

Please sign in to comment.