Skip to content

Commit

Permalink
Updated ESLint config and added eslintignore
Browse files Browse the repository at this point in the history
  • Loading branch information
kpal81xd committed Aug 13, 2024
1 parent b544667 commit 3da58ff
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/dist
/test
13 changes: 0 additions & 13 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,10 @@
},
"rules": {
"accessor-pairs": ["error", { "setWithoutGet": false, "getWithoutSet": false }],
"curly": ["error", "multi-line"],
"import/order": ["error", {
"groups": ["builtin", "external", "internal", ["parent", "sibling"], "index", "unknown"],
"newlines-between": "always",
"alphabetize": { "order": "asc", "caseInsensitive": true }
}],
"indent": ["error", 4, {
"FunctionExpression": { "body": 1, "parameters": 2 },
"MemberExpression": 0,
"SwitchCase": 1
}],
"jsdoc/check-tag-names": ["error", { "definedTags": ["category"] }],
"jsdoc/check-examples": "off",
"no-prototype-builtins": "off",
"no-use-before-define": "off",
"prefer-arrow-callback": ["error", { "allowNamedFunctions": true }],
"prefer-template": "error",
"require-atomic-updates": "warn"
}
}
11 changes: 6 additions & 5 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@babel/core": "^7.23.7",
"@babel/eslint-parser": "^7.23.3",
"@babel/preset-env": "^7.23.8",
"@playcanvas/eslint-config": "^1.7.1",
"@playcanvas/eslint-config": "^1.7.4",
"@playcanvas/observer": "1.3.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
Expand Down
18 changes: 9 additions & 9 deletions src/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class Assets extends Events {
api.realtime.assets.unload(asset.get('uniqueId'));
}

this.emit(`remove`, asset);
this.emit('remove', asset);
this.emit(`remove[${asset.get('id')}]`);
}

Expand Down Expand Up @@ -689,16 +689,16 @@ class Assets extends Events {
return this.createJson({
name: options.name,
json: options.localizationData || {
"header": {
"version": 1
'header': {
'version': 1
},
"data": [{
"info": {
"locale": "en-US"
'data': [{
'info': {
'locale': 'en-US'
},
"messages": {
"key": "Single key translation",
"key plural": ["One key translation", "Translation for {number} keys"]
'messages': {
'key': 'Single key translation',
'key plural': ['One key translation', 'Translation for {number} keys']
}
}]
},
Expand Down
2 changes: 1 addition & 1 deletion src/entities/references.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function findReferencesInComponents(entity, refType) {

// get script attributes
if (!api.hasLegacyScripts && api.assets && component === 'script') {
const scriptComponent = entity.get(`components.script`);
const scriptComponent = entity.get('components.script');
for (const scriptName in scriptComponent.scripts) {
// get script asset
const scriptAsset = api.assets.getAssetForScript(scriptName);
Expand Down
2 changes: 1 addition & 1 deletion src/schema/settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { utils } from "../utils.js";
import { utils } from '../utils.js';

/**
* Provides methods to access the settings schema
Expand Down

0 comments on commit 3da58ff

Please sign in to comment.